protected function installPermissionsAndWorkflow() { $sx = simplexml_load_file(DIR_BASE_CORE . '/config/install/base/permissions.xml'); foreach ($sx->permissioncategories->category as $pkc) { $handle = (string) $pkc['handle']; $pkca = PermissionKeyCategory::getByHandle($handle); if (!is_object($pkca)) { $pkx = PermissionKeyCategory::add((string) $pkc['handle']); } } foreach ($sx->workflowprogresscategories->category as $pkc) { $handle = (string) $pkc['handle']; $pkca = WorkflowProgressCategory::getByHandle($handle); if (!is_object($pkca)) { $pkx = WorkflowProgressCategory::add((string) $pkc['handle']); } } foreach ($sx->workflowtypes->workflowtype as $wt) { $handle = (string) $wt['handle']; $name = (string) $wt['name']; $wtt = WorkflowType::getByHandle($handle); if (!is_object($wtt)) { $pkx = WorkflowType::add($handle, $name); } } if (isset($sx->permissionaccessentitytypes)) { foreach ($sx->permissionaccessentitytypes->permissionaccessentitytype as $pt) { $name = $pt['name']; if (!$name) { $name = Loader::helper('text')->unhandle($pt['handle']); } $handle = (string) $pt['handle']; $patt = PermissionAccessEntityType::getByHandle($handle); if (!is_object($patt)) { $type = PermissionAccessEntityType::add((string) $pt['handle'], $name); if (isset($pt->categories)) { foreach ($pt->categories->children() as $cat) { $catobj = PermissionKeyCategory::getByHandle((string) $cat['handle']); $catobj->associateAccessEntityType($type); } } } } } $txt = Loader::helper('text'); foreach ($sx->permissionkeys->permissionkey as $pk) { $pkc = PermissionKeyCategory::getByHandle((string) $pk['category']); $className = $txt->camelcase($pkc->getPermissionKeyCategoryHandle()); $c1 = $className . 'PermissionKey'; $handle = (string) $pk['handle']; $pka = PermissionKey::getByHandle($handle); if (!is_object($pka)) { $pkx = call_user_func(array($c1, 'import'), $pk); } } }
<? defined('C5_EXECUTE') or die("Access Denied."); $type = PermissionAccessEntityType::getByHandle('group_set'); $url = $type->getAccessEntityTypeToolsURL(); $tp = new TaskPermission(); if (!$tp->canAccessGroupSearch()) { echo(t("You have no access to groups.")); } else { if ($_REQUEST['filter'] == 'assign') { $pk = PermissionKey::getByHandle('assign_user_groups'); if (!$pk->validate()) { die(t('You have no access to assign groups.')); } } $gl = new GroupSetList(); ?> <div id="ccm-list-wrapper"> <? if ($gl->getTotal() > 0) { foreach ($gl->get() as $gs) { ?> <div class="ccm-group"> <div style="background-image: url(<?php echo ASSETS_URL_IMAGES;
public function uninstall() { $type = PermissionAccessEntityType::getByHandle('parent_page_owner'); $type->delete(); parent::uninstall(); }
<?php defined('C5_EXECUTE') or die("Access Denied."); $tp = new TaskPermission(); $dt = Loader::helper('form/date_time'); if (!$tp->canAccessGroupSearch()) { die(t("You do not have group search permissions.")); } $type = PermissionAccessEntityType::getByHandle('group_combination'); $url = $type->getAccessEntityTypeToolsURL(); ?> <div class="ccm-ui"> <form method="post" action="<?php echo $url; ?> " id="ccm-permission-access-entity-combination-groups-form"> <p><?php echo t('Only users who are members of ALL selected groups will be eligible for this permission.'); ?> </p> <table id="ccm-permissions-access-entity-combination-groups" class="table table-bordered"> <tr> <th><div style="width: 16px"></div></th> <th width="100%"><?php echo t("Name"); ?> </th>