Horde_Perms_Permission::addGroupPermission PHP Method

addGroupPermission() public method

Grants a group additional permissions to this object.
public addGroupPermission ( integer $groupId, integer $permission, boolean $update = true )
$groupId integer The id of the group to grant additional permissions to.
$permission integer The permission (DELETE, etc.) to add.
$update boolean Whether to automatically update the backend.
    public function addGroupPermission($groupId, $permission, $update = true)
    {
        if (empty($groupId)) {
            return;
        }
        if ($this->get('type') == 'matrix' && isset($this->data['groups'][$groupId])) {
            $this->data['groups'][$groupId] |= $permission;
        } else {
            $this->data['groups'][$groupId] = $permission;
        }
        if ($update) {
            $this->save();
        }
    }