starting with events, tied to profiles (not accounts)

This commit is contained in:
2023-01-16 14:49:45 +02:00
parent 63299d4464
commit cb54951037
19 changed files with 307 additions and 11 deletions

View File

@ -2,7 +2,11 @@
# which can be viewed by anyone
class EditOwnPolicy < ApplicationPolicy
def edit?
(member == record.member) or member.admin?
return true member.admin?
owner?
end
def owner?
member == record.member
end
alias :update? :edit?
alias :destroy? :edit?

View File

@ -0,0 +1,13 @@
class EventPolicy < EditOwnPolicy
def owner?
member == record.profile.member
end
class Scope < Scope
# NOTE: Be explicit about which records you allow access to!
# def resolve
# scope.all
# end
end
end