DatabaseContext :: protectAction - Protect action
Actions may be protected globally or within a certain context class (by passing the context class name). Protected actions are checked for permission ( permitted() ) before being executed. Since permission checks depend on the application, the permitted() function has to be overloaded by the application.
Implementation overview
- Protect action globally
DatabaseContext :: protectAction ( sActionName ) - Protect action in a specific context
DatabaseContext :: protectAction ( sActionName, sTypeName )
Implementation details
-
Protect action globally
DatabaseContext  :: protectAction ( odaba::String &sActionName )
When an action has been protected globally, those are checked regardless on the context in which those are called. Usually, actions are protected globally by using unique action names.
- sActionName
- Action name
The action name is a name of an action implemented in the context class related to the database source or implemented as default action. Actions can be implemented as expressions, as C++ functions or as .NET function.
In order to pass no action name, an empty string ( String () ) may be passed.
to list
- sActionName
- Action name
-
Protect action in a specific context
DatabaseContext  :: protectAction ( odaba::String &sActionName, odaba::String &sTypeName )
An action may be protected in a specific context by passing the context class name in addition to the action name (e.g. sPerson (type context class for Person ) in order to protect instance actions for a Person ).
- sActionName
- Action name
The action name is a name of an action implemented in the context class related to the database source or implemented as default action. Actions can be implemented as expressions, as C++ functions or as .NET function.
In order to pass no action name, an empty string ( String () ) may be passed.
- sTypeName
- Type name
The type name is the name of a data type (usually) defined in the database. The type name might be passed as simple identifier or as scoped name with preceding namespace names separated by double colon '::'.
In order to pass no type name, an empty string ( String() ) may be passed.
to list
- sActionName
- Action name