Class: NcsNavigator::Authorization::Psc::Authority
- Inherits:
-
Object
- Object
- NcsNavigator::Authorization::Psc::Authority
- Defined in:
- lib/ncs_navigator/authorization/psc/authority.rb
Instance Method Summary collapse
- #get_user_by_id(id, role_detail_level) ⇒ Object
- #get_user_by_username(username, role_detail_level) ⇒ Object
- #get_users_by_role(role_name) ⇒ Object
-
#initialize(ignored_config = nil) ⇒ Authority
constructor
A new instance of Authority.
- #search_users(criteria) ⇒ Object
- #user(staff) ⇒ Object
Constructor Details
#initialize(ignored_config = nil) ⇒ Authority
Returns a new instance of Authority.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ncs_navigator/authorization/psc/authority.rb', line 5 def initialize(ignored_config=nil) @logdir = Java::JavaLang::System.getProperty('catalina.base') @logger = if !@logdir Logger.new($stderr).tap { |l| l.warn("catalina.base property not set; logging to standard error") } else Logger.new("#{@logdir}/logs/ncs_navigator_authority.log") end @staff_portal_connection ||= staff_portal_client.connection end |
Instance Method Details
#get_user_by_id(id, role_detail_level) ⇒ Object
21 22 23 |
# File 'lib/ncs_navigator/authorization/psc/authority.rb', line 21 def get_user_by_id(id, role_detail_level) user(id) end |
#get_user_by_username(username, role_detail_level) ⇒ Object
17 18 19 |
# File 'lib/ncs_navigator/authorization/psc/authority.rb', line 17 def get_user_by_username(username, role_detail_level) user(username) end |
#get_users_by_role(role_name) ⇒ Object
25 26 27 |
# File 'lib/ncs_navigator/authorization/psc/authority.rb', line 25 def get_users_by_role(role_name) users_hash(get_users_collection_by_role(role_name)) end |
#search_users(criteria) ⇒ Object
29 30 31 |
# File 'lib/ncs_navigator/authorization/psc/authority.rb', line 29 def search_users(criteria) users_hash(get_users_by_search_criteria(criteria)) end |
#user(staff) ⇒ Object
33 34 35 |
# File 'lib/ncs_navigator/authorization/psc/authority.rb', line 33 def user(staff) user_hash(get_user_by_username_or_id(staff)) end |