예제 #1
0
 private function GrantGroupOnPage(Usergroup $group, Usergroup $pageGroup, BackendPageRights $pageRights, BackendAction $action)
 {
     if (!$group->Equals($pageGroup)) {
         return GrantResult::NoAccess();
     }
     $allowed = false;
     switch ($action) {
         case BackendAction::Create():
             $allowed = $pageRights->GetCreateIn();
             break;
         case BackendAction::Edit():
             $allowed = $pageRights->GetEdit();
             break;
         case BackendAction::Move():
             $allowed = $pageRights->GetMove();
             break;
         case BackendAction::Delete():
             $allowed = $pageRights->GetRemove();
             break;
         case BackendAction::Read():
             $allowed = $this->HasAnyPageRight($pageRights) || $this->HasAnyContentRight($pageRights->GetContentRights());
     }
     return $allowed ? GrantResult::Allowed() : GrantResult::NoAccess();
 }