getPermissions(); $tmp = $tmp & $permission; return $tmp == $permission; } /** * Adds the given permission or permissions set to the user current permissions * @param $permission */ public function addPermission($permission) { $tmp = $this->getPermissions(); $tmp = $tmp | $permission; $this->setPermissions($tmp); } /** * Takes the given permission or permissions out from the user * @param $permission */ public function removePermission($permission) { $tmp = $this->getPermissions(); $tmp = $tmp & ~$permission; $this->setPermissions($tmp); } }