Class: RubyAem::Resources::Group
- Inherits:
-
Object
- Object
- RubyAem::Resources::Group
- Defined in:
- lib/ruby_aem/resources/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.
28 29 30 31 32 33 34 |
# File 'lib/ruby_aem/resources/group.rb', line 28 def initialize(client, path, name) @client = client @call_params = { 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 |
# File 'lib/ruby_aem/resources/group.rb', line 83 def add_member(member) result = @call_params[:authorizable_id] = result.data @call_params[:member] = member @call_params[:path] = RubyAem::Swagger.path(@call_params[:path]) @client.call(self.class, __callee__.to_s, @call_params) end |
#create ⇒ Object
Create a new group.
39 40 41 42 43 44 |
# File 'lib/ruby_aem/resources/group.rb', line 39 def create() if !@call_params[:path].match(/^\//) @call_params[:path] = "/#{@call_params[:path]}" end @client.call(self.class, __callee__.to_s, @call_params) end |
#delete ⇒ Object
Delete the group.
49 50 51 52 53 54 |
# File 'lib/ruby_aem/resources/group.rb', line 49 def delete() result = @call_params[:authorizable_id] = result.data @call_params[:path] = RubyAem::Swagger.path(@call_params[:path]) @client.call(self.class, __callee__.to_s, @call_params) end |
#exists ⇒ Object
Check whether the group exists or not. If the group exists, this method returns a true result data, false otherwise.
61 62 63 64 65 66 |
# File 'lib/ruby_aem/resources/group.rb', line 61 def exists() result = @call_params[:authorizable_id] = result.data @call_params[:path] = RubyAem::Swagger.path(@call_params[:path]) @client.call(self.class, __callee__.to_s, @call_params) end |
#find_authorizable_id ⇒ Object
Find the group’s authorizable ID. Return authorizable ID as result data, or nil if authorizable ID cannot be found.
96 97 98 |
# File 'lib/ruby_aem/resources/group.rb', line 96 def () @client.call(self.class, __callee__.to_s, @call_params) end |
#set_permission(permission_path, permission_csv) ⇒ Object
Set the group’s permission.
73 74 75 76 77 |
# File 'lib/ruby_aem/resources/group.rb', line 73 def (, ) @call_params[:permission_path] = @call_params[:permission_csv] = @client.call(self.class, __callee__.to_s, @call_params) end |