系统管理员增加组织管理员的权限

This commit is contained in:
ouyangxuhua 2016-01-22 09:54:20 +08:00
parent 5e72734bee
commit a15f7fa97b
1 changed files with 3 additions and 0 deletions

View File

@ -825,6 +825,9 @@ class User < Principal
end
def admin_of_org?(org)
if self.admin?
return true
end
if OrgMember.where("user_id =? and organization_id =?", self.id, org.id).count == 0
return false
end