11 lines
224 B
Ruby
11 lines
224 B
Ruby
|
# allows to edit/detroy own data
|
||
|
# which can be viewed by anyone
|
||
|
class EditOwnPolicy < ApplicationPolicy
|
||
|
def edit?
|
||
|
(member == record.member) or member.admin?
|
||
|
end
|
||
|
alias :update? :edit?
|
||
|
alias :destroy? :edit?
|
||
|
|
||
|
end
|