Code examples

To check if a user has access to a security object, you need to use the has($a, $b, $c) function in Obliquidweb.

function slot_test_() {
   global $_obweb;
       
   //checks the modlang operation for the core module
   if (!$_obweb->has(1, "modlang","")) {
       /* no permission: take an appropriate action */
   }
}
[Tip]The appropriate action to take depends on the context

It may be redirect to another page, hide the slot or remove a functionality (for example don't show a delete button).

has() method accepts three parameters. Notice that currently the third option is not used, but is included for future expansion, and is part of the call. What is placed in each depends on what type of security object is being tested.