Module: GDS::SSO::User
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/gds-sso/user.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #clear_remotely_signed_out! ⇒ Object
- #has_all_permissions?(required_permissions) ⇒ Boolean
- #has_permission?(permission) ⇒ Boolean
- #set_remotely_signed_out! ⇒ Object
Class Method Details
.user_params_from_auth_hash(auth_hash) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gds-sso/user.rb', line 22 def self.user_params_from_auth_hash(auth_hash) { "uid" => auth_hash["uid"], "email" => auth_hash["info"]["email"], "name" => auth_hash["info"]["name"], "permissions" => auth_hash["extra"]["user"]["permissions"], "organisation_slug" => auth_hash["extra"]["user"]["organisation_slug"], "organisation_content_id" => auth_hash["extra"]["user"]["organisation_content_id"], "disabled" => auth_hash["extra"]["user"]["disabled"], } end |
Instance Method Details
#clear_remotely_signed_out! ⇒ Object
34 35 36 |
# File 'lib/gds-sso/user.rb', line 34 def clear_remotely_signed_out! update_attribute(:remotely_signed_out, false) end |
#has_all_permissions?(required_permissions) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/gds-sso/user.rb', line 14 def () if .all? do || .include?() end end end |
#has_permission?(permission) ⇒ Boolean
8 9 10 11 12 |
# File 'lib/gds-sso/user.rb', line 8 def () if .include?() end end |
#set_remotely_signed_out! ⇒ Object
38 39 40 |
# File 'lib/gds-sso/user.rb', line 38 def set_remotely_signed_out! update_attribute(:remotely_signed_out, true) end |