Simplify RBAC get_roles_on_resource method (#14710)

* Simplify RBAC get_roles_on_resource method

* Fix bug

* Fix query type bug
This commit is contained in:
Alan Rominger
2023-12-14 10:42:26 -05:00
committed by GitHub
parent 6440e3cb55
commit b14518c1e5
3 changed files with 14 additions and 39 deletions

View File

@@ -95,13 +95,6 @@ The `singleton` class method is a helper method on the `Role` model that helps i
You may use the `user in some_role` syntax to check and see if the specified
user is a member of the given role, **or** a member of any ancestor role.
#### `get_roles_on_resource(resource, accessor)`
This is a static method (not bound to a class) that will efficiently return the names
of all roles that the `accessor` (a user or a team) has on a particular resource.
The resource is a python object for something like an organization, credential, or job template.
Return value is a list of strings like `["admin_role", "execute_role"]`.
### Fields
#### `ImplicitRoleField`