本文整理匯總了PHP中ilObject::createRoleFolder方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObject::createRoleFolder方法的具體用法?PHP ilObject::createRoleFolder怎麽用?PHP ilObject::createRoleFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilObject
的用法示例。
在下文中一共展示了ilObject::createRoleFolder方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: blockRole
/**
* Blo k role
* @param int $a_role_id
* @param ilObject $source
*/
protected function blockRole($a_role_id, $source)
{
global $rbacadmin, $rbacreview;
// Create role folder if it does not exist
$rolf = $rbacreview->getRoleFolderIdOfObject($source->getRefId());
if (!$rolf) {
$rolf_obj = $source->createRoleFolder();
$rolf = $rolf_obj->getRefId();
}
// Set assign to 'y' only if it is a local role
$assign = $rbacreview->isAssignable($a_role_id, $rolf) ? 'y' : 'n';
// Delete permissions
$rbacadmin->revokeSubtreePermissions($source->getRefId(), $a_role_id);
// Delete template permissions
$rbacadmin->deleteSubtreeTemplates($source->getRefId(), $a_role_id);
$rbacadmin->assignRoleToFolder($a_role_id, $rolf, $assign);
return true;
}
示例2: createRoleFolder
final function createRoleFolder()
{
return parent::createRoleFolder();
}
示例3: testTreeTrash
public function testTreeTrash()
{
global $tree;
$obj = new ilObject();
$obj->setType("xxx");
$obj->setTitle("TestObject");
$obj->setDescription("TestDescription");
$obj->setImportId("imp_44");
$obj->create();
$obj->createReference();
$id = $obj->getId();
$ref_id = $obj->getRefId();
$obj = new ilObject($ref_id);
$obj->putInTree(ROOT_FOLDER_ID);
$obj->createRoleFolder();
$obj->setPermissions(ROOT_FOLDER_ID);
if ($tree->isInTree($ref_id)) {
$value .= "tree1-";
}
if (ilObject::_hasUntrashedReference($id)) {
$value .= "tree2-";
}
// isSaved() uses internal cache!
$tree->useCache(false);
$tree->saveSubTree($ref_id, true);
if ($tree->isDeleted($ref_id)) {
$value .= "tree3-";
}
if ($tree->isSaved($ref_id)) {
$value .= "tree4-";
}
if (ilObject::_isInTrash($ref_id)) {
$value .= "tree5-";
}
if (!ilObject::_hasUntrashedReference($id)) {
$value .= "tree6-";
}
$saved_tree = new ilTree(-(int) $ref_id);
$node_data = $saved_tree->getNodeData($ref_id);
$saved_tree->deleteTree($node_data);
if (!ilObject::_isInTrash($ref_id)) {
$value .= "tree7-";
}
$obs = ilUtil::_getObjectsByOperations("cat", "read");
foreach ($obs as $ob) {
if (ilObject::_lookupType(ilObject::_lookupObjId($ob)) != "cat") {
$value .= "nocat-";
}
}
$obj->delete();
$this->assertEquals("tree1-tree2-tree3-tree4-tree5-tree6-tree7-", $value);
}