Skip to content

Commit

Permalink
Add command to bin/navuser to remove user
Browse files Browse the repository at this point in the history
This is a hard delete so log entries will also be removed.

Co-authored-by: Johanna England <[email protected]>
  • Loading branch information
hmpf and johannaengland authored Nov 2, 2023
1 parent a5d5319 commit 1b3b04e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/navuser
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def adduser(args):
print(msg % args.login, file=sys.stderr)


def removeuser(args):
args.login.delete()
print("User %s has been removed" % args.login.login, file=sys.stderr)


def adminify(args):
action = args.action
try:
Expand Down Expand Up @@ -216,6 +221,12 @@ def parse_args():
)
addparser.set_defaults(func=adduser)

removeparser = subparsers.add_parser('remove', help='Removes a user')
removeparser.set_defaults(func=removeuser)
removeparser.add_argument(
'login', type=usergetter, help="The login name of the user"
)

adminifyparser = subparsers.add_parser(
'admin', help='Sets whether an existing user belongs to the admin group'
)
Expand Down

0 comments on commit 1b3b04e

Please sign in to comment.