Skip to content

Commit

Permalink
implement admin grant and revoke
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonChen666 committed Oct 10, 2023
1 parent d4c7e6e commit 0a19786
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions synadm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,7 @@ def user_unlock(self, user_id):
return self._user_modify_api(user_id, {"locked": False})

def user_set_admin(self, user_id, admin):
# TODO
pass
return self._user_modify_api(user_id, {"admin": admin})

def user_whois(self, user_id):
""" Return information about the active sessions for a specific user
Expand Down
6 changes: 2 additions & 4 deletions synadm/cli/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,16 +594,14 @@ def unlock(helper, user_id):
@click.argument("user_id", type=str)
@click.pass_obj
def admin_grant(helper, user_id):
# TODO
pass
result = helper.api.user_set_admin(user_id, True)


@user.command()
@click.argument("user_id", type=str)
@click.pass_obj
def admin_revoke(helper, user_id):
# TODO
pass
result = helper.api.user_set_admin(user_id, False)


@user.command()
Expand Down

0 comments on commit 0a19786

Please sign in to comment.