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);
}
}