use member settings, remove show, tighter pundit
This commit is contained in:
11
app/policies/admin_policy.rb
Normal file
11
app/policies/admin_policy.rb
Normal file
@ -0,0 +1,11 @@
|
||||
# allows to edit/detroy own data
|
||||
# which can be viewed by anyone
|
||||
class AdminPolicy < ApplicationPolicy
|
||||
def edit?
|
||||
member.admin?
|
||||
end
|
||||
alias :update? :edit?
|
||||
alias :show? :edit?
|
||||
alias :destroy? :edit?
|
||||
|
||||
end
|
Reference in New Issue
Block a user