Add Approval to User
This commit is contained in:
		
							parent
							
								
									9bc79fddd7
								
							
						
					
					
						commit
						9260c3d2b7
					
				|  | @ -20,6 +20,7 @@ class User | |||
|   field :office_tel | ||||
|   field :cache_dept,type: Hash | ||||
|   field :status_record,type: Hash | ||||
|   field :approved, type: Boolean, :default => false | ||||
| 
 | ||||
|   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' | ||||
|  | @ -296,9 +297,17 @@ class User | |||
|     end | ||||
|   end | ||||
| 
 | ||||
|   # def active_for_authentication?  | ||||
|   #   super && approved?  | ||||
|   # end  | ||||
|   def active_for_authentication?  | ||||
|     super && approved?  | ||||
|   end | ||||
| 
 | ||||
|   def inactive_message  | ||||
|     if !approved?  | ||||
|       :not_approved  | ||||
|     else  | ||||
|       super | ||||
|     end  | ||||
|   end | ||||
|    | ||||
|   private | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue