Contact, Questions, Discussion
All contents and concepts
©Webware nach Maß
The Readable Programming Language - Handbook
A role is defined by a least one "can" sentence.
The roles collected from the "can" sentences build an automatically defined enumeration.
There are 3 predefined roles:
The visitor will automatically find a login form on the (predefined) "Home" page.
It is a good idea to provide the (logged in) user with a possibility to logout, for instance:
If the visitor can do something (apart from logging in), then any logged in user can do it also. The user could do it anyway by logging out and becoming a visitor - we spare him this step.
A user who has the admin role can do anything that other users can do, plus the actions that have been specifically programmed for this role Motivation.
X The motivation for the existence of the admin role comes from the following experience:
If you don't like admins, just don't give this role to any user. X
A structure may have the same name as a role (except the visitor role), allowing the programmer to add attributes to users depending on their roles.
There's a predefined structure corresponding to the "user" role. It has 3 predefined attributes:
If a structure is defined with the same name as a role, when the role is added to a user's role list, an instance of this structure (a role object) is automatically created and attached to the user.
All operations made on a role object (creating one, storing it in a variable, adding it to a list, destroying it, etc.) concern in reality its owner user: "a reviewer" means "a user who has the reviewer role".
When a role is removed from the role list of a user, the corresponding eventual role object may be destroyed or just detached from the user and archived, depending on the translator.
The attributes of a role object are handled as if they'd belong to its owner user. They will be null (meaning: not accessible) if the user hasn't got this role.
No structure can be named "visitor" and associated with the visitor role. Use the session structure instead.