Backend\Core\Installer\ModuleInstaller::setActionRights PHP Метод

setActionRights() защищенный Метод

Set the rights for an action
protected setActionRights ( integer $groupId, string $module, string $action, integer $level = 7 )
$groupId integer The group wherefore the rights will be set.
$module string The module wherein the action appears.
$action string The action wherefore the rights have to set.
$level integer The level, default is 7 (max).
    protected function setActionRights($groupId, $module, $action, $level = 7)
    {
        $groupId = (int) $groupId;
        $module = (string) $module;
        $action = (string) $action;
        $level = (int) $level;
        // check if the action already exists
        $exists = (bool) $this->getDB()->getVar('SELECT 1
             FROM groups_rights_actions
             WHERE group_id = ? AND module = ? AND action = ?
             LIMIT 1', array($groupId, $module, $action));
        // action doesn't exist
        if (!$exists) {
            // build item
            $item = array('group_id' => $groupId, 'module' => $module, 'action' => $action, 'level' => $level);
            $this->getDB()->insert('groups_rights_actions', $item);
        }
    }