consistent permissions

This commit is contained in:
Devin Howard 2016-03-11 21:32:18 +08:00
parent 615eaf580e
commit 73b82801cc
3 changed files with 6 additions and 9 deletions

View file

@ -43,6 +43,6 @@ class MapPolicy < ApplicationPolicy
end end
def destroy? def destroy?
record.user == user || user.admin record.user == user || admin_override
end end
end end

View file

@ -10,16 +10,14 @@ class SynapsePolicy < ApplicationPolicy
end end
def show? def show?
# record.permission == 'commons' || record.permission == 'public' || record.user == user record.permission == 'commons' || record.permission == 'public' || record.user == user
true
end end
def update? def update?
# user.present? && (record.permission == 'commons' || record.user == user) user.present? && (record.permission == 'commons' || record.user == user)
true
end end
def destroy? def destroy?
record.user == user || user.admin record.user == user || admin_override
end end
end end

View file

@ -14,12 +14,11 @@ class TopicPolicy < ApplicationPolicy
end end
def update? def update?
# user.present? && (record.permission == 'commons' || record.user == user) user.present? && (record.permission == 'commons' || record.user == user)
true
end end
def destroy? def destroy?
record.user == user || user.admin record.user == user || admin_override
end end
def autocomplete_topic? def autocomplete_topic?