Module: ActiveSP::Root
Instance Method Summary collapse
- #group(name) ⇒ Object
-
#groups ⇒ Array<Group>
Returns the list of groups in the system.
-
#roles ⇒ Array<Role>
Returns the list of roles in the system.
-
#root ⇒ Site
Returns the root site as an object of class Site.
-
#user(login) ⇒ User?
Returns the user with the given login, or nil when the user does not exist.
-
#users ⇒ Array<User>
Returns the list of users in the system.
Methods included from Caching
Instance Method Details
#group(name) ⇒ Object
77 78 79 80 81 |
# File 'lib/activesp/root.rb', line 77 def group(name) if group = groups_by_name[name] group end end |
#groups ⇒ Array<Group>
Returns the list of groups in the system
69 70 71 72 73 74 |
# File 'lib/activesp/root.rb', line 69 def groups root.send(:call, "UserGroup", "get_group_collection_from_site").xpath("//spdir:Group", NS).map do |row| attributes = clean_attributes(row.attributes) Group.new(root, attributes["Name"]) end end |
#roles ⇒ Array<Role>
Returns the list of roles in the system
85 86 87 88 89 90 |
# File 'lib/activesp/root.rb', line 85 def roles root.send(:call, "UserGroup", "get_role_collection_from_web").xpath("//spdir:Role", NS).map do |row| attributes = clean_attributes(row.attributes) Role.new(root, attributes["Name"]) end end |
#root ⇒ Site
Returns the root site as an object of class Site
41 42 43 |
# File 'lib/activesp/root.rb', line 41 def root Site.new(self, @root_url) end |
#user(login) ⇒ User?
Returns the user with the given login, or nil when the user does not exist
59 60 61 62 63 64 65 |
# File 'lib/activesp/root.rb', line 59 def user(login) if user = users_by_login[login] user elsif data = root.send(:call, "UserGroup", "get_user_info", "userLoginName" => login).xpath("//spdir:User", NS).first users_by_login[login] = User.new(root, login, clean_attributes(data)) end end |
#users ⇒ Array<User>
Returns the list of users in the system
48 49 50 51 52 53 |
# File 'lib/activesp/root.rb', line 48 def users root.send(:call, "UserGroup", "get_user_collection_from_site").xpath("//spdir:User", NS).map do |row| attributes = clean_attributes(row.attributes) User.new(root, attributes["LoginName"]) end end |