mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 12:36:56 +00:00
Fix typo hasPemission to hasPermission (#7141)
This commit is contained in:
parent
d9003a90e7
commit
26b1bfb343
@ -190,7 +190,7 @@ jest.mock('../../hooks/authHooks', () => ({
|
||||
}));
|
||||
|
||||
jest.mock('../../utils/PermissionsUtils', () => ({
|
||||
hasPemission: jest.fn().mockReturnValue(false),
|
||||
hasPermission: jest.fn().mockReturnValue(false),
|
||||
}));
|
||||
|
||||
describe('Test EntityLineage Component', () => {
|
||||
|
||||
@ -36,7 +36,7 @@ import { useAuth } from '../../hooks/authHooks';
|
||||
import jsonData from '../../jsons/en';
|
||||
import { TagsCategory } from '../../pages/tags/tagsTypes';
|
||||
import { getOwnerList } from '../../utils/ManageUtils';
|
||||
import { hasPemission } from '../../utils/PermissionsUtils';
|
||||
import { hasPermission } from '../../utils/PermissionsUtils';
|
||||
import { showErrorToast } from '../../utils/ToastUtils';
|
||||
import {
|
||||
searchFormattedUsersAndTeams,
|
||||
@ -284,7 +284,7 @@ const ManageTab: FunctionComponent<ManageProps> = ({
|
||||
return (
|
||||
isAdminUser ||
|
||||
isAuthDisabled ||
|
||||
hasPemission(
|
||||
hasPermission(
|
||||
Operation.EditUsers,
|
||||
entityType as EntityType,
|
||||
userPermissions
|
||||
|
||||
@ -41,7 +41,7 @@ import { TeamDetailsProp } from '../../interface/teamsAndUsers.interface';
|
||||
import UserCard from '../../pages/teams/UserCard';
|
||||
import { hasEditAccess } from '../../utils/CommonUtils';
|
||||
import { filterEntityAssets } from '../../utils/EntityUtils';
|
||||
import { hasPemission } from '../../utils/PermissionsUtils';
|
||||
import { hasPermission } from '../../utils/PermissionsUtils';
|
||||
import SVGIcons from '../../utils/SvgUtils';
|
||||
import { Button } from '../buttons/Button/Button';
|
||||
import Description from '../common/description/Description';
|
||||
@ -133,7 +133,7 @@ const TeamDetails = ({
|
||||
isHidden: !(
|
||||
hasAccess ||
|
||||
isOwner() ||
|
||||
hasPemission(Operation.EditOwner, EntityType.TEAM, userPermissions)
|
||||
hasPermission(Operation.EditOwner, EntityType.TEAM, userPermissions)
|
||||
),
|
||||
position: 4,
|
||||
},
|
||||
@ -346,7 +346,7 @@ const TeamDetails = ({
|
||||
: `added yet.`}
|
||||
</p>
|
||||
{isActionAllowed(
|
||||
hasPemission(
|
||||
hasPermission(
|
||||
Operation.EditUsers,
|
||||
EntityType.TEAM,
|
||||
userPermissions
|
||||
|
||||
@ -26,7 +26,7 @@ import { useAuth } from '../../../hooks/authHooks';
|
||||
import jsonData from '../../../jsons/en';
|
||||
import { hasEditAccess } from '../../../utils/CommonUtils';
|
||||
import { getTitleCase } from '../../../utils/EntityUtils';
|
||||
import { hasPemission } from '../../../utils/PermissionsUtils';
|
||||
import { hasPermission } from '../../../utils/PermissionsUtils';
|
||||
import { showErrorToast } from '../../../utils/ToastUtils';
|
||||
import { isCurrentUserAdmin } from '../../../utils/UserDataUtils';
|
||||
import { Button } from '../../buttons/Button/Button';
|
||||
@ -162,7 +162,7 @@ const OwnerWidget = ({
|
||||
return false;
|
||||
}
|
||||
|
||||
return hasPemission(
|
||||
return hasPermission(
|
||||
Operation.EditOwner,
|
||||
entityType as EntityType,
|
||||
userPermissions
|
||||
|
||||
@ -28,7 +28,7 @@ import {
|
||||
getPartialNameFromFQN,
|
||||
getPartialNameFromTableFQN,
|
||||
} from '../../utils/CommonUtils';
|
||||
import { hasPemission } from '../../utils/PermissionsUtils';
|
||||
import { hasPermission } from '../../utils/PermissionsUtils';
|
||||
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
||||
import { getEntityLink } from '../../utils/TableUtils';
|
||||
|
||||
@ -239,7 +239,7 @@ const UserCard = ({
|
||||
!isAdminUser &&
|
||||
!isAuthDisabled &&
|
||||
!isOwner &&
|
||||
!hasPemission(
|
||||
!hasPermission(
|
||||
Operation.EditUsers,
|
||||
EntityType.TEAM,
|
||||
userPermissions
|
||||
|
||||
@ -29,7 +29,7 @@ import { Operation } from '../generated/entity/policies/policy';
|
||||
* @deprecated
|
||||
* TODO: Remove this method once we have new permission structure everywhere
|
||||
*/
|
||||
export const hasPemission = (
|
||||
export const hasPermission = (
|
||||
operation: Operation,
|
||||
entityType: EntityType,
|
||||
permissions: ResourcePermission[]
|
||||
@ -60,18 +60,19 @@ export const checkPermission = (
|
||||
const isAuthDisabled = AppState.authDisabled;
|
||||
const allResource = permissions?.all;
|
||||
const entityResource = permissions?.[resourceType];
|
||||
let hasPemission = isAuthDisabled;
|
||||
let hasPermission = isAuthDisabled;
|
||||
|
||||
/**
|
||||
* If allresource is present then check for permission and return it
|
||||
*/
|
||||
if (allResource && !hasPemission) {
|
||||
hasPemission = allResource.All || allResource[operation];
|
||||
if (allResource && !hasPermission) {
|
||||
hasPermission = allResource.All || allResource[operation];
|
||||
}
|
||||
|
||||
hasPemission = hasPemission || (entityResource && entityResource[operation]);
|
||||
hasPermission =
|
||||
hasPermission || (entityResource && entityResource[operation]);
|
||||
|
||||
return hasPemission;
|
||||
return hasPermission;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user