xotcl.wu-wien.ac.at
Begin main content
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xotcl::Class[i] ::xo::ConnectionContext

Class Hierarchy of ::xo::ConnectionContext

  • ::xotcl::Object[i]
    Meta-class:
    ::xotcl::Class[i]
    Methods for instances:
    __api_make_doc, __api_make_forward_doc, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, check, classC, cleanupC, configureC, containsC, copyC, db_0or1rowC, db_1rowC, debug, defaultmethodC, destroyC, destroy_on_cleanup, ds, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearch, forward, hasclass, incrC, infoC, init, instvarC, invarC, isclass, ismetaclass, ismixin, isobject, istype, lappendC, log, method, mixinC, mixinguardC, moveC, msg, noinitC, objectparameter, parametercmdC, proc, procsearch, qn, requireNamespaceC, residualargsC, self, serialize, setC, set_instance_vars_defaults, show-object, substC, traceC, unknown, unsetC, uplevelC, upvarC, volatileC, vwait
    Methods to be applied on the class (in addition to the methods provided by the meta-class):
    getExitHandler, setExitHandler, unsetExitHandler
    • ::xo::Context[i]
      Meta-class:
      ::xotcl::Class[i]
      Parameter for instances:
      actual_query (default " "), locale, package_id (default "0"), parameter_declaration (default "")
      Methods for instances:
      exists_query_parameter, export_vars, get_all_query_parameter, get_parameters, initialize, original_url_and_query, process_query_parameter, query_parameter
      Methods to be applied on the class:
      Methods provided by the meta-class
      • ::xo::ConnectionContext[i]
        Meta-class:
        ::xotcl::Class[i]
        Parameter for instances:
        mobile, requestor, url, user, user_id
        Methods for instances:
        cache, cache_exists, cache_get, cache_set, cache_unset, exists_form_parameter, exists_parameter, form_parameter, get_all_form_parameter, get_parameter, get_user_id, init, lang, load_form_parameter, permission, returnredirect, role=admin, role=all, role=app_group_member, role=community_member, role=creator, role=registered_user, role=swa, role=unregistered_user, set_parameter, set_user_id
        Methods to be applied on the class (in addition to the methods provided by the meta-class):
        require, require_package_id_from_url

Class Relations

  • superclass: ::xo::Context[i]
::xotcl::Class create ::xo::ConnectionContext \
     -superclass ::xo::Context \
     -parameter {mobile requestor url user user_id}

Methods

  • instproc permission (public)

    <instance of ::xo::ConnectionContext[i]> permission \
        -object_id object_id  -privilege privilege  [ -party_id party_id ]
    call ::permission::permission_p but avoid multiple calls in the same session through caching in the connection context

    Switches:
    -object_id (required)
    -privilege (required)
    -party_id (optional)
    ::395118 instproc permission {-object_id:required -privilege:required -party_id} {
        if {![info exists party_id]} {
          set party_id [my user_id]
        }
        # my log "--  context permission user_id=$party_id uid=[::xo::cc user_id] untrusted=[::xo::cc set untrusted_user_id]"
        if {$party_id == 0} {
          set key permission($object_id,$privilege,$party_id)
          if {[my exists $key]} {return [my set $key]}
          set granted [permission::permission_p -no_login -party_id $party_id  -object_id $object_id  -privilege $privilege]
          #my msg "--p lookup $key ==> $granted uid=[my user_id] uuid=[my set untrusted_user_id]"
          if {$granted || [my user_id] == [my set untrusted_user_id]} {
            my set $key $granted
            return $granted
          }
          # The permission is not granted for the public.
          # We force the user to login
          #my log "-- require login"
          #auth::require_login
          return 0
        }
    
        set key permission($object_id,$privilege,$party_id)
        if {[my exists $key]} {return [my set $key]}
        #my msg "--p lookup $key"
        my set $key [permission::permission_p -no_login  -party_id $party_id  -object_id $object_id  -privilege $privilege]
        #my log "--  context return [my set $key]"
        #my set $key
      }
    

Instances

::xo::cc[i]

Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]