Comment to 'How do I create new actions or new set of actions for permissions?'
  • Hello zhalkiar !

    If you need to create a new action which is missing in the ready UNA 's code you need to perform the following actions:

    1) add in your code the calling of the function checkActionModule from the inc/classes/BxDolAcl.php file where need to pass item id (profile or entry), name of the action (like 'view entry') and name of the module (use the $this->getName() method calling) it will look like:

    $aCheck = checkActionModule($this->_iProfileId, 'allow view', $this->getName(), $isPerformAction);

    if ($aCheck[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED) {

    // code of allowed action

    }

    2) add the record about this action to the sys_acl_actions table, for the given example it will look like:

    INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES

    ('{module name}', '{action name [this name will be added to the allow prefix ] }', NULL, '{the language key of the title}', '', 1, 0);

    SET @iIdActionProfileView = LAST_INSERT_ID();