use member settings, remove show, tighter pundit

This commit is contained in:
Torsten
2023-09-01 15:22:24 +03:00
parent 973ede68b2
commit 55cade0df5
6 changed files with 37 additions and 65 deletions

View 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