fix bugs with token
This commit is contained in:
1 parent
cc550c5745
commit
2e58c63ff7
8 files changed
+31
-12
No files matched your search
@@ -1,6 +1,7 @@
|
||||
class ModuleApp
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitCoreLib::ObjectTokenUnility
|
||||
|
||||
field :key
|
||||
field :title
|
||||
@@ -14,7 +15,7 @@ class ModuleApp
|
||||
|
||||
field :app_pages ,type: Array
|
||||
field :widgets ,type: Array
|
||||
|
||||
|
||||
has_many :managers,as: :managing_app ,:class_name => "AppManager" #,:dependent => :destroy,:foreign_key => "managing_app_id",:inverse_of => :managing_app
|
||||
has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager"#, :dependent => :destroy,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app
|
||||
|
||||
@@ -81,5 +82,6 @@ class ModuleApp
|
||||
def set_key
|
||||
self.key = self.title.underscore if self.title
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class ObjectAuth < PrototypeAuth
|
||||
|
||||
include OrbitCoreLib::ObjectTokenUnility
|
||||
belongs_to :obj_authable, polymorphic: true
|
||||
# > - Something.find_with_auth(query)
|
||||
# > - or Something.find(query).auth
|
||||
|
||||
@@ -4,7 +4,6 @@ class PrototypeAuth
|
||||
# after_save :update_block_list,:update_privilage_list
|
||||
|
||||
field :title
|
||||
field :token
|
||||
field :all ,type: Boolean,default: false
|
||||
|
||||
belongs_to :users
|
||||
@@ -12,12 +11,13 @@ class PrototypeAuth
|
||||
has_and_belongs_to_many :blocked_users, :inverse_of => nil, :class_name => "User"
|
||||
has_and_belongs_to_many :privilege_users, :inverse_of => nil, :class_name => "User"
|
||||
|
||||
|
||||
has_and_belongs_to_many :roles
|
||||
has_and_belongs_to_many :sub_roles
|
||||
|
||||
attr_protected :roles,:sub_roles,:privilege_users,:blocked_users
|
||||
|
||||
|
||||
|
||||
def add_role role
|
||||
add_operation(:roles,role)
|
||||
end
|
||||
@@ -87,7 +87,6 @@ class PrototypeAuth
|
||||
auth_users_before_block_list - self.blocked_users
|
||||
end
|
||||
|
||||
# protected
|
||||
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user