diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/permissions/utils.ts')
-rw-r--r-- | server/sonar-web/src/main/js/apps/permissions/utils.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/permissions/utils.ts b/server/sonar-web/src/main/js/apps/permissions/utils.ts index 1fd5ab17dd4..ba61c427d98 100644 --- a/server/sonar-web/src/main/js/apps/permissions/utils.ts +++ b/server/sonar-web/src/main/js/apps/permissions/utils.ts @@ -19,6 +19,7 @@ */ import { hasMessage, translate } from '../../helpers/l10n'; import { isSonarCloud } from '../../helpers/system'; +import { Dict, PermissionDefinition, PermissionDefinitionGroup } from '../../types/types'; export const PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE = [ 'user', @@ -40,7 +41,7 @@ export const PERMISSIONS_ORDER_FOR_VIEW = ['user', 'admin']; export const PERMISSIONS_ORDER_FOR_DEV = ['user', 'admin']; -export const PERMISSIONS_ORDER_BY_QUALIFIER: T.Dict<string[]> = { +export const PERMISSIONS_ORDER_BY_QUALIFIER: Dict<string[]> = { TRK: PERMISSIONS_ORDER_FOR_PROJECT_TEMPLATE, VW: PERMISSIONS_ORDER_FOR_VIEW, SVW: PERMISSIONS_ORDER_FOR_VIEW, @@ -91,7 +92,7 @@ export function filterPermissions( export function convertToPermissionDefinitions( permissions: Array<string | { category: string; permissions: string[] }>, l10nPrefix: string -): Array<T.PermissionDefinition | T.PermissionDefinitionGroup> { +): Array<PermissionDefinition | PermissionDefinitionGroup> { return permissions.map(permission => { if (typeof permission === 'object') { return { @@ -106,7 +107,7 @@ export function convertToPermissionDefinitions( } export function isPermissionDefinitionGroup( - permission?: T.PermissionDefinition | T.PermissionDefinitionGroup -): permission is T.PermissionDefinitionGroup { - return Boolean(permission && (permission as T.PermissionDefinitionGroup).category); + permission?: PermissionDefinition | PermissionDefinitionGroup +): permission is PermissionDefinitionGroup { + return Boolean(permission && (permission as PermissionDefinitionGroup).category); } |