mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
Add missing permission helper for folder deletion [SCI-6114] (#3568)
This commit is contained in:
parent
bf96f71531
commit
1233c9bc74
1 changed files with 9 additions and 0 deletions
|
@ -54,6 +54,15 @@ Canaid::Permissions.register_for(Team) do
|
|||
end
|
||||
end
|
||||
|
||||
Canaid::Permissions.register_for(ProjectFolder) do
|
||||
# ProjectFolder: delete
|
||||
can :delete_project_folder do |user, project_folder|
|
||||
user.is_admin_of_team?(project_folder.team) &&
|
||||
project_folder.projects.none? &&
|
||||
project_folder.project_folders.none?
|
||||
end
|
||||
end
|
||||
|
||||
Canaid::Permissions.register_for(Protocol) do
|
||||
# protocol in repository: read, export, read step, read/download step asset
|
||||
can :read_protocol_in_repository do |user, protocol|
|
||||
|
|
Loading…
Reference in a new issue