transferred Code Ocean from original repository to GitHub
This commit is contained in:
9
app/policies/admin_or_author_policy.rb
Normal file
9
app/policies/admin_or_author_policy.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class AdminOrAuthorPolicy < ApplicationPolicy
|
||||
[:create?, :index?, :new?].each do |action|
|
||||
define_method(action) { @user.internal? }
|
||||
end
|
||||
|
||||
[:destroy?, :edit?, :show?, :update?].each do |action|
|
||||
define_method(action) { admin? || author? }
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user