Class: Confluence::Group
- Inherits:
-
Object
- Object
- Confluence::Group
- Defined in:
- lib/confluence/group.rb
Class Method Summary collapse
-
.all ⇒ Array<String>
Retrieve a list of all groups in Confluence.
-
.create(name) ⇒ true, false
Creates a new group in Confluence.
-
.delete(name) ⇒ true, false
Delete a group from Confluence.
-
.exists?(grp_name) ⇒ true, false
Predicate that indicates whether a given group exists in Confluence.
Class Method Details
.all ⇒ Array<String>
Retrieve a list of all groups in Confluence.
9 10 11 |
# File 'lib/confluence/group.rb', line 9 def all() Confluence.conn.getGroups() end |
.create(name) ⇒ true, false
Creates a new group in Confluence.
19 20 21 22 23 24 25 26 27 |
# File 'lib/confluence/group.rb', line 19 def create(name) if all.include?(name) return false else result = Confluence.conn.addGroup(name) Confluence.logger.debug("Created group: #{name}") end result end |
.delete(name) ⇒ true, false
Delete a group from Confluence.
35 36 37 38 39 40 41 42 43 |
# File 'lib/confluence/group.rb', line 35 def delete(name) if all.include?(name) result = Confluence.conn.removeGroup(name, Confluence::User::DEFAULT_GROUP) Confluence.logger.debug("Deleted group: #{name}") return result else return false end end |
.exists?(grp_name) ⇒ true, false
Predicate that indicates whether a given group exists in Confluence
51 52 53 |
# File 'lib/confluence/group.rb', line 51 def exists?(grp_name) all.include?(grp_name) end |