Class: RubyAem::Group
- Inherits:
-
Object
- Object
- RubyAem::Group
- Defined in:
- lib/ruby_aem/group.rb
Overview
Group class contains API calls related to managing an AEM group.
Instance Method Summary collapse
-
#add_member(member) ⇒ Object
Add another group as a member of this group.
-
#create ⇒ Object
Create a new group.
-
#delete ⇒ Object
Delete the group.
-
#exists ⇒ Object
Check whether the group exists or not.
-
#find_authorizable_id ⇒ Object
Find the group’s authorizable ID.
-
#initialize(client, path, name) ⇒ Object
constructor
Initialise a group.
-
#set_permission(permission_path, permission_csv) ⇒ Object
Set the group’s permission.
Constructor Details
#initialize(client, path, name) ⇒ Object
Initialise a group.
27 28 29 30 31 32 33 |
# File 'lib/ruby_aem/group.rb', line 27 def initialize(client, path, name) @client = client @info = { path: path, name: name } end |
Instance Method Details
#add_member(member) ⇒ Object
Add another group as a member of this group.
83 84 85 86 87 88 89 90 91 |
# File 'lib/ruby_aem/group.rb', line 83 def add_member(member) result = if result.data @info[:member] = member @client.call(self.class, __callee__.to_s, @info) else result end end |
#create ⇒ Object
Create a new group.
38 39 40 41 42 43 |
# File 'lib/ruby_aem/group.rb', line 38 def create() if !@info[:path].match(/^\//) @info[:path] = "/#{@info[:path]}" end @client.call(self.class, __callee__.to_s, @info) end |
#delete ⇒ Object
Delete the group.
48 49 50 51 52 53 54 55 56 |
# File 'lib/ruby_aem/group.rb', line 48 def delete() result = if result.data @info[:path] = RubyAem::Swagger.path(@info[:path]) @client.call(self.class, __callee__.to_s, @info) else result end end |
#exists ⇒ Object
Check whether the group exists or not. If the group exists, this method returns a success result. Otherwise it returns a failure result.
63 64 65 66 |
# File 'lib/ruby_aem/group.rb', line 63 def exists() @info[:path] = RubyAem::Swagger.path(@info[:path]) @client.call(self.class, __callee__.to_s, @info) end |
#find_authorizable_id ⇒ Object
Find the group’s authorizable ID.
96 97 98 |
# File 'lib/ruby_aem/group.rb', line 96 def () @client.call(self.class, __callee__.to_s, @info) end |
#set_permission(permission_path, permission_csv) ⇒ Object
Set the group’s permission.
73 74 75 76 77 |
# File 'lib/ruby_aem/group.rb', line 73 def (, ) @info[:permission_path] = @info[:permission_csv] = @client.call(self.class, __callee__.to_s, @info) end |