Ejemplo n.º 1
0
 /**
  * True if a new member group can be created
  * @return bool
  */
 protected function CanCreate()
 {
     return self::Guard()->Allow(BackendAction::Create(), new Membergroup());
 }
Ejemplo n.º 2
0
 /**
  * 
  * @return bool
  */
 protected function CanCreate()
 {
     return self::Guard()->Allow(BackendAction::Create(), new Area()) && self::Guard()->Allow(BackendAction::UseIt(), new AreaForm());
 }
Ejemplo n.º 3
0
 /**
  * True if page can be appended
  * @param Page $page The page before
  * @return bool
  */
 protected function CanCreateAfter()
 {
     $parent = $this->tree->ParentOf($this->page);
     if ($parent) {
         return BackendModule::Guard()->Allow(BackendAction::Create(), $parent);
     }
     return BackendModule::Guard()->GrantAddPageToSite($this->page->GetSite())->ToBool();
 }
Ejemplo n.º 4
0
 /**
  * True if user can create a new layout
  * @return bool
  */
 protected function CanCreate()
 {
     return self::Guard()->Allow(BackendAction::Create(), new Layout());
 }
Ejemplo n.º 5
0
 /**
  * Grant evaluation for adding content on top of a container
  * @param Container $container The container
  * @return GrantResult Returns the grant result telling if creation is allowed
  */
 function GrantAddContentToContainer(Container $container)
 {
     //dummy content for evaluation
     $content = new Content();
     $content->SetUserGroup($container->GetUserGroup());
     $containerRights = $container->GetUserGroupRights();
     if ($containerRights) {
         $content->SetUserGroupRights($containerRights->GetContentRights());
     }
     return $this->Grant(BackendAction::Create(), $content);
 }
Ejemplo n.º 6
0
 /**
  * True if there can be content created after
  * @return boolean
  */
 protected final function CanCreateAfter()
 {
     $parentItem = $this->tree->ParentOf($this->item);
     if ($parentItem) {
         $parent = $this->tree->ContentByItem($parentItem);
         return BackendModule::Guard()->Allow(BackendAction::Create(), $parent);
     }
     return $this->GrantCreateInRoot()->ToBool();
 }