mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 15:14:33 +08:00
Fix form response permission for actived tasks [SCI-11860]
This commit is contained in:
parent
c8101013d9
commit
c79b600c02
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,7 @@ Canaid::Permissions.register_for(FormResponse) do
|
|||
case parent
|
||||
when Step
|
||||
next false unless parent.protocol.my_module # protocol template forms can't be submitted
|
||||
next false if parent.protocol.my_module.archived
|
||||
next false unless form_response.pending?
|
||||
|
||||
parent.protocol.my_module.permission_granted?(user, FormResponsePermissions::SUBMIT)
|
||||
|
@ -26,6 +27,7 @@ Canaid::Permissions.register_for(FormResponse) do
|
|||
case parent
|
||||
when Step
|
||||
next false unless parent.protocol.my_module # protocol template forms can't be reset
|
||||
next false if parent.protocol.my_module.archived
|
||||
next false unless form_response.submitted?
|
||||
|
||||
parent.protocol.my_module.permission_granted?(user, FormResponsePermissions::RESET)
|
||||
|
|
Loading…
Add table
Reference in a new issue