New authorization
This commit is contained in:
1 parent
d24bd176cc
commit
c474fa063f
25 files changed
+440
-172
No files matched your search
@@ -19,12 +19,16 @@ class User
|
||||
field :cache_dept,type: Hash
|
||||
field :status_record,type: Hash
|
||||
|
||||
has_and_belongs_to_many :approving_apps, class_name: 'AuthApproval', inverse_of: 'authorized_users'
|
||||
has_and_belongs_to_many :managing_apps, class_name: 'AuthManager', inverse_of: 'authorized_users'
|
||||
has_and_belongs_to_many :sub_managing_apps, class_name: 'AuthSubManager', inverse_of: 'authorized_users'
|
||||
|
||||
has_many :attribute_values, :autosave => true, :dependent => :destroy
|
||||
has_many :app_auths,as: :privilege_apps,:inverse_of => :privilege_lists
|
||||
has_many :blocked_apps, :inverse_of => :blocked_users, :class_name => "AppAuth", :dependent => :destroy
|
||||
has_many :privilege_apps, :inverse_of => :privilege_users, :class_name => "AppAuth", :dependent => :destroy
|
||||
|
||||
has_many :managing_apps,:class_name => "AppManager", :dependent => :destroy
|
||||
# has_many :managing_apps,:class_name => "AppManager", :dependent => :destroy
|
||||
has_one :desktop, :autosave => true, :dependent => :destroy
|
||||
has_one :facebook, :autosave => true, :dependent => :destroy
|
||||
has_many :other_accounts, :autosave => true, :dependent => :destroy
|
||||
@@ -273,8 +277,8 @@ class User
|
||||
end
|
||||
|
||||
def managed_module_apps
|
||||
self.managing_apps.inject([]) do |managed_apps, app_manager|
|
||||
managed_apps << app_manager.managing_app unless app_manager.managing_app.blank?
|
||||
self.managing_apps.inject([]) do |managed_apps, auth_manager|
|
||||
managed_apps << auth_manager.module_app
|
||||
managed_apps
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user