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
def destroy?
record.user == user || user.admin
record.user == user || admin_override
end
end

View file

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

View file

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