| |
@@ -10601,9 +10601,13 @@
|
| |
"""Get a list of the permissions granted to the currently logged-in user."""
|
| |
return context.session.getPerms()
|
| |
|
| |
- def getUserPerms(self, userID):
|
| |
- """Get a list of the permissions granted to the user with the given ID."""
|
| |
- return koji.auth.get_user_perms(userID)
|
| |
+ def getUserPerms(self, userID=None):
|
| |
+ """Get a list of the permissions granted to the user with the given ID/name.
|
| |
+ Options:
|
| |
+ - userID: User ID or username. If no userID provided, current login user's
|
| |
+ permissions will be listed."""
|
| |
+ user_info = get_user(userID, strict=True)
|
| |
+ return koji.auth.get_user_perms(user_info['id'])
|
| |
|
| |
def getAllPerms(self):
|
| |
"""Get a list of all permissions in the system. Returns a list of maps. Each
|
| |
to fix issue#486
When specified userID is not found,
GenericError
will be thrown instead of[]
resultIf user exists and no perm for this user, the result will keep
[]
as usual time.