Class ::xo::Policy

::xo::Policy[i] create ...

Defined in

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Object[i]
  • subclass: ::xowiki::Policy[i]

Methods (to be applied on instances)

  • check_permissions (scripted, public)

     <instance of xo::Policy[i]> 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
  • check_privilege (scripted)

  • defined_methods (scripted)

  • enforce_permissions (scripted, public)

     <instance of xo::Policy[i]> 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
  • get_permission (scripted)

  • get_privilege (scripted)

Variables

::xo::Policy set __default_metaclass ::xotcl::Class
::xo::Policy set __default_superclass ::xotcl::Object