diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 488b67d6..999c5bc3 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -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