Roles¶
Methods described in this section relate to the roles API.
These methods can be accessed at TenableIE.roles
.
- class RolesAPI(api: APISession)[source]¶
- copy_role(from_id: str, name: str) → Dict[source]¶
Creates a new role from another role
- Parameters:
- Returns:
the copied role object.
- Return type:
Examples
>>> tie.roles.copy_role( ... from_id='1', ... name='Copied name' ... )
- create(name: str, description: int) → List[Dict][source]¶
Create a new role
- Parameters:
- Returns:
The created role object.
- Return type:
Examples
>>> tie.roles.create( ... name='Admin', ... description="all privileges" ... )
- default_roles() → List[Dict][source]¶
Return the default roles for user creation
Examples
>>> tie.roles.default_roles()
- delete(role_id: str) → None[source]¶
Delete an existing role
- Parameters:
role_id (str) – The role instance identifier.
- Return type:
None
Examples
>>> tie.roles.delete( ... role_id='1', ... )
- details(role_id: str) → Dict[source]¶
Retrieves the details of a specific role.
- Parameters:
role_id (str) – The role instance identifier.
- Returns:
the role object.
- Return type:
Examples
>>> tie.roles.details( ... role_id='1' ... )
- replace_role_permissions(role_id: str, permissions: List[Dict]) → Dict[source]¶
Replace permission list for a role
- Parameters:
role_id (str) – The role instance identifier.
permissions (List[Dict]) – The list of permissions dictionaries. Below are the values expected in dictionaries
entity_name (str) – The name of entity.
action (str) – The code of action to perform.
entity_ids (List[int]) – The list of entity identifiers.
dynamic_id (optional, str) – The dynamicId to use associated with the action.
- Returns:
the update permissions role object.
- Return type:
Examples
>>> tie.roles.replace_role_permissions( ... role_id='1', ... permissions=[{ ... 'entity_name':'dashboard', ... 'action':'action', ... 'entity_ids':[1, 2], ... 'dynamic_id': None ... }] ... )