/** * True if a new member group can be created * @return bool */ protected function CanCreate() { return self::Guard()->Allow(BackendAction::Create(), new Membergroup()); }
/** * * @return bool */ protected function CanCreate() { return self::Guard()->Allow(BackendAction::Create(), new Area()) && self::Guard()->Allow(BackendAction::UseIt(), new AreaForm()); }
/** * 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(); }
/** * True if user can create a new layout * @return bool */ protected function CanCreate() { return self::Guard()->Allow(BackendAction::Create(), new Layout()); }
/** * 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); }
/** * 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(); }