- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xo::Policy
::xo::Policycreate ...
Defined in
Class Relations
Methods (to be applied on instances)
check_permissions (scripted, public)
<instance of xo::Policy> check_permissions [ -user_id user_id ] \ [ -package_id package_id ] [ -link link ] object method
This method checks whether the current or specified user is allowed to invoke a method based on the given policy. This method is purely checking and does not force logins or other side effects. It can be safely used for example to check whether links should be shown or not.
- Switches:
- -user_id (optional, integer)
- -package_id (optional, integer)
- -link (optional)
- Parameters:
- object (required, object)
- method (required)
- Returns:
- 0 or 1
- See Also:
- enforce_permissions
- Testcases:
- xowiki_test_cases
enforce_permissions (scripted, public)
<instance of xo::Policy> enforce_permissions \ [ -user_id user_id ] [ -package_id package_id ] object method
This method checks whether the current user is allowed or not to invoke a method based on the given policy and forces logins if required.
- Switches:
- -user_id (optional, integer)
- -package_id (optional, integer)
- Parameters:
- object (required, object)
- method (required)
- Returns:
- 0 or 1
- See Also:
- check_permissions
- Testcases:
- xowiki_test_cases
Variables
::xo::Policy set __default_metaclass ::xotcl::Class ::xo::Policy set __default_superclass ::xotcl::Object
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables