private function SaveRights() { $groupID = $this->Value('UserGroup'); $userGroup = Usergroup::Schema()->ByID($groupID); $this->site->SetUserGroup($userGroup); if (!$userGroup) { $oldRights = $this->site->GetUserGroupRights(); if ($oldRights) { $oldRights->GetPageRights()->GetContentRights()->Delete(); } $this->site->SetUserGroupRights(null); } else { $this->siteRights->Save(); $this->site->SetUserGroupRights($this->siteRights->Rights()); } $this->site->Save(); }