mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 05:05:55 +08:00
15 lines
462 B
Ruby
15 lines
462 B
Ruby
# frozen_string_literal: true
|
|
|
|
Canaid::Permissions.register_for(Result) do
|
|
can :read_result do |user, result|
|
|
can_read_experiment?(user, result.my_module.experiment)
|
|
end
|
|
|
|
can :manage_result do |user, result|
|
|
can_manage_module?(user, result.my_module) && result.active? && result.unlocked?(result)
|
|
end
|
|
|
|
can :delete_result do |user, result|
|
|
can_manage_module?(user, result.my_module) && result.archived? && result.unlocked?(result)
|
|
end
|
|
end
|