-
Notifications
You must be signed in to change notification settings - Fork 467
chore: permission types #6417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kyle-ssg
wants to merge
17
commits into
feat/edit-versioned-change-request
Choose a base branch
from
chore/permission-types
base: feat/edit-versioned-change-request
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+544
−163
Open
chore: permission types #6417
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a89df89
Enumerate permission types
kyle-ssg ae5582e
Merge branch 'feat/edit-versioned-change-request' into chore/permissi…
kyle-ssg 0313fd7
Merge branch 'feat/edit-versioned-change-request' into chore/permissi…
kyle-ssg 7b4029c
Migrate permissions to enum
kyle-ssg 6bc28f1
Migrate permissions to enum
kyle-ssg 512696b
Small typos
kyle-ssg 2afaba5
Fix identity override permission
kyle-ssg 5907ed3
Fix import name
kyle-ssg a1825eb
Update frontend/common/constants.ts
kyle-ssg 39fa2a4
Update frontend/web/components/modals/create-feature/index.js
kyle-ssg fc49c2b
Update frontend/web/components/modals/create-feature/index.js
kyle-ssg cdd78a1
Improve permission types
kyle-ssg d329c91
Improve permission types
kyle-ssg 58b4245
Refactor permission descriptions
kyle-ssg 0f3407a
Merge feat/edit-versioned-change-request into chore/permission-types
kyle-ssg 0c1fcb4
Unused imports
kyle-ssg 6d6c865
Refactor Constants.environmentPermissions usages
kyle-ssg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| // Organization Permissions | ||
| export enum OrganisationPermission { | ||
| CREATE_PROJECT = 'CREATE_PROJECT', | ||
| MANAGE_USERS = 'MANAGE_USERS', | ||
| MANAGE_USER_GROUPS = 'MANAGE_USER_GROUPS', | ||
| } | ||
| export const OrganisationPermissionDescriptions = { | ||
| [OrganisationPermission.CREATE_PROJECT]: 'Create project', | ||
| [OrganisationPermission.MANAGE_USERS]: 'Manage users', | ||
| [OrganisationPermission.MANAGE_USER_GROUPS]: 'Manage user groups', | ||
| } as const | ||
|
|
||
| export type OrganisationPermissionDescription = | ||
| | (typeof OrganisationPermissionDescriptions)[keyof typeof OrganisationPermissionDescriptions] | ||
| | typeof ADMIN_PERMISSION_DESCRIPTION | ||
|
|
||
| export const ADMIN_PERMISSION = 'ADMIN' as const | ||
| export const ADMIN_PERMISSION_DESCRIPTION = 'Administrator' as const | ||
|
|
||
| // Project Permissions | ||
| export enum ProjectPermission { | ||
| VIEW_PROJECT = 'VIEW_PROJECT', | ||
| CREATE_ENVIRONMENT = 'CREATE_ENVIRONMENT', | ||
| DELETE_FEATURE = 'DELETE_FEATURE', | ||
| CREATE_FEATURE = 'CREATE_FEATURE', | ||
| MANAGE_SEGMENTS = 'MANAGE_SEGMENTS', | ||
| VIEW_AUDIT_LOG = 'VIEW_AUDIT_LOG', | ||
| MANAGE_TAGS = 'MANAGE_TAGS', | ||
| MANAGE_PROJECT_LEVEL_CHANGE_REQUESTS = 'MANAGE_PROJECT_LEVEL_CHANGE_REQUESTS', | ||
| APPROVE_PROJECT_LEVEL_CHANGE_REQUESTS = 'APPROVE_PROJECT_LEVEL_CHANGE_REQUESTS', | ||
| CREATE_PROJECT_LEVEL_CHANGE_REQUESTS = 'CREATE_PROJECT_LEVEL_CHANGE_REQUESTS', | ||
| } | ||
| export const ProjectPermissionDescriptions = { | ||
| [ProjectPermission.VIEW_PROJECT]: 'View project', | ||
| [ProjectPermission.CREATE_ENVIRONMENT]: 'Create environment', | ||
| [ProjectPermission.DELETE_FEATURE]: 'Delete feature', | ||
| [ProjectPermission.CREATE_FEATURE]: 'Create feature', | ||
| [ProjectPermission.MANAGE_SEGMENTS]: 'Manage segments', | ||
| [ProjectPermission.VIEW_AUDIT_LOG]: 'View audit log', | ||
| [ProjectPermission.MANAGE_TAGS]: 'Manage tags', | ||
| [ProjectPermission.MANAGE_PROJECT_LEVEL_CHANGE_REQUESTS]: | ||
| 'Manage project level change requests', | ||
| [ProjectPermission.APPROVE_PROJECT_LEVEL_CHANGE_REQUESTS]: | ||
| 'Approve project level change requests', | ||
| [ProjectPermission.CREATE_PROJECT_LEVEL_CHANGE_REQUESTS]: | ||
| 'Create project level change requests', | ||
| } as const | ||
|
|
||
| export type ProjectPermissionDescription = | ||
| | (typeof ProjectPermissionDescriptions)[keyof typeof ProjectPermissionDescriptions] | ||
| | typeof ADMIN_PERMISSION_DESCRIPTION | ||
|
|
||
| // Environment Permissions | ||
| export enum EnvironmentPermission { | ||
| VIEW_ENVIRONMENT = 'VIEW_ENVIRONMENT', | ||
| UPDATE_FEATURE_STATE = 'UPDATE_FEATURE_STATE', | ||
| MANAGE_IDENTITIES = 'MANAGE_IDENTITIES', | ||
| CREATE_CHANGE_REQUEST = 'CREATE_CHANGE_REQUEST', | ||
| APPROVE_CHANGE_REQUEST = 'APPROVE_CHANGE_REQUEST', | ||
| VIEW_IDENTITIES = 'VIEW_IDENTITIES', | ||
| MANAGE_SEGMENT_OVERRIDES = 'MANAGE_SEGMENT_OVERRIDES', | ||
| } | ||
| export const EnvironmentPermissionDescriptions = { | ||
| [EnvironmentPermission.VIEW_ENVIRONMENT]: 'View environment', | ||
| [EnvironmentPermission.UPDATE_FEATURE_STATE]: 'Update feature state', | ||
| [EnvironmentPermission.MANAGE_IDENTITIES]: 'Manage identities', | ||
| [EnvironmentPermission.CREATE_CHANGE_REQUEST]: 'Create change request', | ||
| [EnvironmentPermission.APPROVE_CHANGE_REQUEST]: 'Approve change request', | ||
| [EnvironmentPermission.VIEW_IDENTITIES]: 'View identities', | ||
| [EnvironmentPermission.MANAGE_SEGMENT_OVERRIDES]: 'Manage segment overrides', | ||
| } as const | ||
|
|
||
| export type EnvironmentPermissionDescription = | ||
| | (typeof EnvironmentPermissionDescriptions)[keyof typeof EnvironmentPermissionDescriptions] | ||
| | typeof ADMIN_PERMISSION_DESCRIPTION | ||
|
|
||
| export type Permission = | ||
| | OrganisationPermission | ||
| | ProjectPermission | ||
| | EnvironmentPermission | ||
| | typeof ADMIN_PERMISSION | ||
|
|
||
| // Combined permission descriptions record | ||
| export const PermissionDescriptions = { | ||
| ...OrganisationPermissionDescriptions, | ||
| ...ProjectPermissionDescriptions, | ||
| ...EnvironmentPermissionDescriptions, | ||
| [ADMIN_PERMISSION]: ADMIN_PERMISSION_DESCRIPTION, | ||
| } as const |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.