Library: roles

From Yombo
Jump to: navigation, search
roles
Commonly Used Yes
Status Active

Summary
Roles group permissions together and can be assigned to users and authentication keys.

Introduction

Users and authentication keys are assigned roles, such as "admin" and "device manager". Permissions are assigned to roles to grant (or revoke) various permissions. See permission feature for more details.

Roles can be managed from the web interface.

See also

Hooks

No hooks registered.

Usage

Step 1: Create role

Creating a role within a module very simple. First, check to make sure the role doesn't already exist. If it doesn't, simply create one.

1 try:
2     self.role = self._Roles.get("module_amazonalexa_api")
3 except KeyError:
4     self.new(machine_label="module_amazonalexa_api",
5         label="Amazon Alexa - API",
6         description="Used by Amazon Alexa to make requests to this module. No one else should have this role."
7         created_by="amazonalexa",
8         created_by_type="module"
9     )

Step 2: Attach permissions

See permissions for details on adding a new permissions to the role.


This page was last edited on 23 July 2019.