39 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
50 global $rbacreview,$rbacadmin;
53 $non_empty = $rbacreview->filterEmptyRoleFolders(array(8));
54 $this->assertEquals($non_empty,array(8));
57 $empty = $rbacreview->filterEmptyRoleFolders(array(1));
58 $this->assertEquals($empty,array());
61 $rbacadmin->setProtected(1,4,
'y');
62 $prot = $rbacreview->isProtected(8,4);
63 $this->assertEquals($prot,
true);
64 $rbacadmin->setProtected(1,4,
'n');
65 $prot = $rbacreview->isProtected(8,4);
66 $this->assertEquals($prot,
false);
68 $rbacreview->getRoleListByObject(8);
69 $rbacreview->getAssignableRoles();
72 $child1 = $rbacreview->getAssignableRolesInSubtree(8);
73 $child2 = $rbacreview->getAssignableChildRoles(8);
74 $this->assertEquals($child1,$child2);
76 $ass = $rbacreview->isAssignable(4,8);
77 $this->assertEquals($ass,
true);
79 $roles = $rbacreview->getRolesOfRoleFolder(8);
80 $rbacreview->__getAllRoleFolderIds();
82 $rbacreview->getLinkedRolesOfRoleFolder(8);
84 $obj = $rbacreview->getObjectOfRole(4);
85 $this->assertEquals(9,$obj);
87 $rbacreview->getRolesForIDs(array(4),
false);
95 global $rbacreview,$rbacadmin;
99 $rbacreview->assignedUsers(4);
100 $rbacreview->assignedRoles(6);
110 global $rbacreview,$rbacadmin;
112 $sess_ops = $rbacreview->getOperationsOnTypeString(
'sess');
114 $rbacadmin->assignOperationToObject($rbacreview->getTypeId(
'sess'),
'7');
118 $rbacadmin->deassignOperationFromObject($rbacreview->getTypeId(
'sess'),
'7');
119 $new_sess_ops = $rbacreview->getOperationsOnTypeString(
'sess');
120 $this->assertEquals($sess_ops,$new_sess_ops);
128 global $rbacreview,$rbacadmin;
130 $sess_ops = $rbacreview->getOperationsOnTypeString(
'cat');
132 $rbacadmin->revokePermission(1,4);
133 $rbacadmin->grantPermission(4,array(2,3),1);
144 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
150 $handler->setTargetRefId(99999);
151 $handler->setTargetObjId(99998);
152 $handler->setTargetType(
'xxx');
153 $handler->setTriggerRefId(99997);
154 $handler->setTriggerObjId(99996);
155 $handler->setTriggerType(
'yyy');
156 $handler->setReferenceHandlingType(0);
157 $handler->enableAutomaticValidation(
false);
158 $suc = $handler->storeCondition();
159 $this->assertEquals($suc,
true);
161 $suc = $handler->checkExists();
162 $this->assertEquals($suc,
false);
164 $suc = $handler->delete(99999);
165 $this->assertEquals($suc,
true);
168 $handler->deleteByObjId(-1);
169 $handler->deleteCondition(-1);
177 include_once
'./Services/AccessControl/classes/class.ilAccessHandler.php';
180 $handler->setResults(array(1,2,3));
181 $handler->storeCache();
182 $handler->readCache();
183 $res = $handler->getResults();
185 $this->assertEquals(array(1,2,3),
$res);