Skip to content

Commit

Permalink
Confluence:add user
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonchik Tsymzhitov committed Jul 16, 2020
1 parent 6b5a592 commit 12793dd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def get_parent_content_id(self, page_id):
parent_content_id = None
try:
parent_content_id = (
(self.get_page_by_id(page_id=page_id, expand='ancestors').get('ancestors') or {})[-1].get(
'id') or None)
(self.get_page_by_id(page_id=page_id, expand='ancestors').get('ancestors') or {})[-1].get(
'id') or None)
except Exception as e:
log.error(e)
return parent_content_id
Expand Down Expand Up @@ -1939,6 +1939,15 @@ def avatar_set_default_for_user(self, user_key):
url = 'rest/user-profile/1.0/{}/avatar/default'.format(user_key)
return self.get(url)

def add_user(self, email, fullname, username, password):
"""
That method related to creating user via json rpc for Confluence Server
"""
params = {"email": email, "fullname": fullname, "name": username}
url = 'rpc/json-rpc/confluenceservice-v2'
data = {"jsonrpc": "2.0", "method": "addUser", "params": [params, password]}
self.post(url, data=data)

def add_user_to_group(self, username, group_name):
"""
Add given user to a group
Expand Down

0 comments on commit 12793dd

Please sign in to comment.