%3 ::xotcl::Object ::xotcl::Object ::xo::Policy ::xo::Policy check_permissions enforce_permissions ::xo::Policy->::xotcl::Object ::xowiki::Policy ::xowiki::Policy ::xowiki::Policy->::xo::Policy

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
  • 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