コード例 #1
0
ファイル: Group.php プロジェクト: ceko/concrete5-1
 public static function add()
 {
     // copy permissions from the other node.
     $rootNode = GroupTreeNode::add();
     $treeID = parent::create($rootNode);
     $tree = self::getByID($treeID);
     return $tree;
 }
コード例 #2
0
ファイル: Topic.php プロジェクト: ceko/concrete5-1
 public static function add($name)
 {
     // copy permissions from the other node.
     $rootNode = TopicCategoryTreeNode::add();
     $treeID = parent::create($rootNode);
     $tree = self::getByID($treeID);
     $tree->setTopicTreeName($name);
     // by default, topic trees are viewable by all
     $guestGroupEntity = GroupPermissionAccessEntity::getOrCreate(UserGroup::getByID(GUEST_GROUP_ID));
     $pk = TopicCategoryTreeNodePermissionKey::getByHandle('view_topic_category_tree_node');
     $pk->setPermissionObject($rootNode);
     $pa = PermissionAccess::create($pk);
     $pa->addListItem($guestGroupEntity);
     $pt = $pk->getPermissionAssignmentObject();
     $pt->assignPermissionAccess($pa);
     return $tree;
 }
コード例 #3
0
 public static function add()
 {
     // copy permissions from the other node.
     $rootNode = ExpressEntryCategory::add();
     $treeID = parent::create($rootNode);
     $tree = self::getByID($treeID);
     $adminGroupEntity = GroupEntity::getOrCreate(ConcreteGroup::getByID(ADMIN_GROUP_ID));
     $permissions = ['view_express_entries', 'add_express_entries', 'edit_express_entries', 'delete_express_entries'];
     foreach ($permissions as $handle) {
         $pk = ExpressTreeNodeKey::getByHandle($handle);
         $pk->setPermissionObject($rootNode);
         $pa = Access::create($pk);
         $pa->addListItem($adminGroupEntity);
         $pt = $pk->getPermissionAssignmentObject();
         $pt->assignPermissionAccess($pa);
     }
     return $tree;
 }