wuttjamaican.db.model.auth
¶
Auth Models
The auth handler is primarily responsible for managing the data for these models.
Basic design/structure is as follows:
User
may be assigned to multiple rolesRole
may be granted multiple permissionsPermission
is a permission granted to a roleroles are not nested/grouped; each is independent
a few roles are built-in, e.g. Administrators
So a user’s permissions are “inherited” from the role(s) to which they belong.
- class wuttjamaican.db.model.auth.Permission(**kwargs)[source]¶
Represents a permission granted to a role.
- permission¶
Key (name) of the permission which is granted.
- class wuttjamaican.db.model.auth.Role(**kwargs)[source]¶
Represents an authentication role within the system; used for permission management.
- permissions¶
List of keys (string names) for permissions granted to this role.
See also
permission_refs
.
- name¶
Name for the role. Each role must have a name, which must be unique.
- notes¶
Arbitrary notes for the role.
- permission_refs¶
List of
Permission
references for the role.See also
permissions
.
- class wuttjamaican.db.model.auth.User(**kwargs)[source]¶
Represents a user of the system.
This may or may not correspond to a real person, i.e. some users may exist solely for automated tasks.
- active¶
Flag indicating whether the user account is “active” - it is
True
by default.The default auth logic will prevent login for “inactive” user accounts.
- password¶
Hashed password for login. (The raw password is not stored.)
- prevent_edit¶
If set, this user account can only be edited by root. User cannot change their own password.
- username¶
Account username. This is required and must be unique.