From a15f7fa97bbcd5154d0fbae0fddcae1df191ca05 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 22 Jan 2016 09:54:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index f3367db59..d89f2f57a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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