First version for App and Object auth.Taking Announcement as experiment

This commit is contained in:
Matthew Kaito Juyuan Fu authored and Christophe Vilayphiou committed 2012-02-29 18:55:55 +08:00
1 parent 3bcd7ea349
commit cc550c5745
28 files changed
+146 -34

No files matched your search

+1
View File
@@ -2,4 +2,5 @@ class AppAuth < PrototypeAuth
belongs_to :module_app
end
+8
View File
@@ -26,6 +26,14 @@ class ModuleApp
before_save :set_key
def is_manager?(user)
managing_users.include?(user)
end
def is_sub_manager?(user)
sub_managing_users.include?(user) || is_manager?(user)
end
def managing_users
self.managers.collect{ |t| t.user }
end
+1 -1
View File
@@ -16,7 +16,7 @@ class PrototypeAuth
has_and_belongs_to_many :roles
has_and_belongs_to_many :sub_roles
attr_protected :roles,:sub_roles,:privilege_users,:blocked_users,:users
attr_protected :roles,:sub_roles,:privilege_users,:blocked_users
def add_role role
add_operation(:roles,role)