Skip to content

Commit

Permalink
Fix permissions style
Browse files Browse the repository at this point in the history
  • Loading branch information
kazcw committed Jul 11, 2024
1 parent b189cea commit 9c9768f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
15 changes: 0 additions & 15 deletions app/ide-desktop/lib/common/src/utilities/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ export enum Permission {
delete = 'delete',
}

/** CSS classes for each permission. */
export const PERMISSION_CLASS_NAME: Readonly<Record<Permission, string>> = {
[Permission.owner]: 'text-tag-text bg-permission-owner',
[Permission.admin]: 'text-tag-text bg-permission-admin',
[Permission.edit]: 'text-tag-text bg-permission-edit',
[Permission.read]: 'text-tag-text bg-permission-read',
[Permission.view]: 'text-tag-text-2 bg-permission-view',
[Permission.delete]: 'text-tag-text bg-delete',
}

/** Precedences for each permission. A lower number means a higher priority. */
export const PERMISSION_PRECEDENCE: Readonly<Record<Permission, number>> = {
// These are not magic numbers - they are just a sequence of numbers.
Expand Down Expand Up @@ -86,11 +76,6 @@ export const PERMISSION_ACTION_PRECEDENCE: Readonly<Record<PermissionAction, num
/* eslint-enable @typescript-eslint/no-magic-numbers */
}

/** CSS classes for the docs permission. */
export const DOCS_CLASS_NAME = 'text-tag-text bg-permission-docs'
/** CSS classes for the execute permission. */
export const EXEC_CLASS_NAME = 'text-tag-text bg-permission-exec'

/** The corresponding {@link Permissions} for each {@link PermissionAction}. */
export const FROM_PERMISSION_ACTION: Readonly<Record<PermissionAction, Permissions>> = {
[PermissionAction.own]: { type: Permission.owner },
Expand Down
17 changes: 17 additions & 0 deletions app/ide-desktop/lib/dashboard/src/utilities/permissions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/** @file Utilities for working with permissions. */

import * as permissions from 'enso-common/src/utilities/permissions'

export * from 'enso-common/src/utilities/permissions'

/** CSS classes for each permission. */
export const PERMISSION_CLASS_NAME: Readonly<Record<permissions.Permission, string>> = {
[permissions.Permission.owner]: 'text-tag-text bg-permission-owner',
[permissions.Permission.admin]: 'text-tag-text bg-permission-admin',
[permissions.Permission.edit]: 'text-tag-text bg-permission-edit',
[permissions.Permission.read]: 'text-tag-text bg-permission-read',
[permissions.Permission.view]: 'text-tag-text-2 bg-permission-view',
[permissions.Permission.delete]: 'text-tag-text bg-delete',
}

/** CSS classes for the docs permission. */
export const DOCS_CLASS_NAME = 'text-tag-text bg-permission-docs'
/** CSS classes for the execute permission. */
export const EXEC_CLASS_NAME = 'text-tag-text bg-permission-exec'

0 comments on commit 9c9768f

Please sign in to comment.