mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Remove comments
This commit is contained in:
parent
29ae5c04f1
commit
a93cb8ff41
2 changed files with 0 additions and 7 deletions
|
|
@ -8,14 +8,12 @@ class Family::InvitationPolicy < ApplicationPolicy
|
||||||
end
|
end
|
||||||
|
|
||||||
def accept?
|
def accept?
|
||||||
# Users can accept invitations sent to their email
|
|
||||||
return false unless user
|
return false unless user
|
||||||
|
|
||||||
user.email == record.email
|
user.email == record.email
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
# Only family owners can cancel invitations
|
|
||||||
create?
|
create?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@ class Family::MembershipPolicy < ApplicationPolicy
|
||||||
return false unless user
|
return false unless user
|
||||||
return false unless record.is_a?(Family::Invitation)
|
return false unless record.is_a?(Family::Invitation)
|
||||||
|
|
||||||
# User can only accept invitations that:
|
|
||||||
# 1. Are for their email address
|
|
||||||
# 2. Are still pending
|
|
||||||
# 3. Haven't expired
|
|
||||||
record.email == user.email && record.pending? && !record.expired?
|
record.email == user.email && record.pending? && !record.expired?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -16,7 +12,6 @@ class Family::MembershipPolicy < ApplicationPolicy
|
||||||
return false unless user
|
return false unless user
|
||||||
return true if user == record.user
|
return true if user == record.user
|
||||||
|
|
||||||
# Family owners can remove other members
|
|
||||||
user.family == record.family && user.family_owner?
|
user.family == record.family && user.family_owner?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue