mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-15 03:49:24 +08:00
Forgot to remove unneeded code form permissions after the previous refactoring.
This commit is contained in:
parent
53f75f3cd6
commit
fa7710fb80
1 changed files with 3 additions and 16 deletions
|
@ -136,32 +136,19 @@ Canaid::Permissions.register_for(Protocol) do
|
||||||
# protocol in module: read
|
# protocol in module: read
|
||||||
# step in module: read, read comments, read/download assets
|
# step in module: read, read comments, read/download assets
|
||||||
can :read_protocol_in_module do |user, protocol|
|
can :read_protocol_in_module do |user, protocol|
|
||||||
if protocol.in_module?
|
can_read_experiment?(user, protocol.my_module.experiment)
|
||||||
can_read_experiment?(user, protocol.my_module.experiment)
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# protocol in module: create/update/delete, unlink, revert, update from
|
# protocol in module: create/update/delete, unlink, revert, update from
|
||||||
# protocol in repository, update from file
|
# protocol in repository, update from file
|
||||||
# step in module: create/update/delete, reorder
|
# step in module: create/update/delete, reorder
|
||||||
can :manage_protocol_in_module do |user, protocol|
|
can :manage_protocol_in_module do |user, protocol|
|
||||||
if protocol.in_module?
|
can_manage_module?(user, protocol.my_module)
|
||||||
can_manage_module?(user, protocol.my_module)
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# step: complete/uncomplete
|
# step: complete/uncomplete
|
||||||
can :complete_or_checkbox_step do |user, protocol|
|
can :complete_or_checkbox_step do |user, protocol|
|
||||||
if protocol.in_module?
|
can_complete_module?(user, protocol.my_module)
|
||||||
can_complete_module?(user, protocol.my_module)
|
|
||||||
else
|
|
||||||
# In repository, user cannot complete steps
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue