Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config/AppAbility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {Ability, AbilityClass} from '@casl/ability';
type Actions = 'manage' | 'create' | 'read' | 'update' | 'delete' | 'archive' | 'access' | 'submit';
type Subjects = 'ProgramUser' | 'Location' | 'User' | 'AdminSection' | 'Trait' | 'Import' | 'ProgramConfiguration' | 'Submission'
| 'Experiment' | 'Germplasm' | 'Ontology' | 'SampleManagement' | 'ProgramAdministration' | 'JobManagement' | 'Collaborator' | 'BrAPI'
| 'List';
| 'SubEntityDataset' | 'List';

export type AppAbility = Ability<[Actions, Subjects]>;
export const AppAbility = Ability as AbilityClass<AppAbility>;
1 change: 1 addition & 0 deletions src/config/ability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const rolePermissions: Record<string, DefinePermissions> = {
can('update', 'Trait');
can('archive', 'Trait');
can('create', 'Import');
can('create', 'SubEntityDataset');
can('delete', 'Experiment');
can('access', 'ProgramConfiguration');
can('create', 'ProgramConfiguration');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export default class ExperimentDetails extends ProgramsBase {
new ActionMenuItem('experiment-import-file', 'import-file', 'Import file', this.$ability.can('create', 'Import')),
new ActionMenuItem('experiment-download-file', 'download-file', 'Download file'),
new ActionMenuItem('experiment-add-collaborator', 'add-collaborator', 'Add Collaborator', this.$ability.can('manage', 'Collaborator')),
new ActionMenuItem('experiment-create-sub-entity-dataset', 'create-sub-entity-dataset', 'Create Sub-Entity Dataset'),
new ActionMenuItem('experiment-create-sub-entity-dataset', 'create-sub-entity-dataset', 'Create Sub-Entity Dataset', this.$ability.can('create', 'SubEntityDataset')),
new ActionMenuItem('experiment-delete', 'delete-experiment', 'Delete experiment', this.$ability.can('delete', 'Experiment'))
];

Expand Down
Loading