4 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateAction.php';
51 $this->pattern = $patterns;
69 $this->filter_type = $a_type;
87 $this->role_template_type = $a_tpl_type;
104 $this->role_template_id = $a_id;
125 $query =
'INSERT INTO didactic_tpl_alp (action_id,filter_type,template_type,template_id) '.
132 $ilDB->manipulate(
$query);
138 $pattern->setParentType(self::PATTERN_PARENT_TYPE);
148 public function delete()
154 $query =
'DELETE FROM didactic_tpl_alp '.
155 'WHERE action_id = '.$ilDB->quote($this->
getActionId(),
'integer');
156 $ilDB->manipulate(
$query);
181 foreach($roles as $role_id => $role)
184 if($role[
'protected'] and $role[
'parent'] != $source->getRefId())
200 global $rbacreview,$rbacadmin,$tree;
206 foreach($roles as $role_id => $role)
209 if(!$rbacreview->isGlobalRole($role[
'obj_id']) and
210 $rbacreview->isAssignable($role[
'obj_id'],$source->getRefId()) and
211 $rbacreview->isSystemGeneratedRole($role[
'obj_id']))
218 $rbacadmin->deleteLocalRole($role_id,$source->getRefId());
220 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
222 $role_obj->changeExistingObjects(
255 case self::FILTER_SOURCE_TITLE:
256 $writer->
xmlStartTag(
'roleFilter',array(
'source' =>
'title'));
259 case self::FILTER_SOURCE_OBJ_ID:
260 $writer->
xmlStartTag(
'roleFilter',array(
'source' =>
'objId'));
267 $pattern->toXml($writer);
275 case self::TPL_ACTION_OVERWRITE:
277 'localPolicyTemplate',
279 'type' =>
'overwrite',
285 case self::TPL_ACTION_INTERSECT:
287 'localPolicyTemplate',
289 'type' =>
'intersect',
295 case self::TPL_ACTION_UNION:
297 'localPolicyTemplate',
306 include_once
'./Services/AccessControl/classes/class.ilRoleXmlExport.php';
311 $writer->
appendXML($exp->xmlDumpMem(FALSE));
312 $writer->
xmlEndTag(
'localPolicyTemplate');
342 $query =
'SELECT * FROM didactic_tpl_alp '.
343 'WHERE action_id = '.$ilDB->quote($this->
getActionId());
353 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
369 global $rbacreview, $rbacadmin;
371 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using role: '.print_r($role,
true));
376 if(!$rbacreview->isRoleAssignedToObject($role[
'obj_id'],$source->
getRefId()))
378 $rbacadmin->assignRoleToFolder($role[
'obj_id'],$source->
getRefId(),
'n');
383 case self::TPL_ACTION_UNION:
385 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRolePermissionUnion()');
386 $rbacadmin->copyRolePermissionUnion(
396 case self::TPL_ACTION_OVERWRITE:
398 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRoleTemplatePermissions()');
399 $rbacadmin->copyRoleTemplatePermissions(
408 case self::TPL_ACTION_INTERSECT:
410 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRolePermissionIntersection()');
411 $rbacadmin->copyRolePermissionIntersection(
424 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
425 $role_obj =
new ilObjRole($role[
'obj_id']);
426 $role_obj->changeExistingObjects(
437 global $rbacadmin, $rbacreview,
$ilDB;
439 $GLOBALS[
'ilLog']->write(__METHOD__.
': Reverting policy for role: '.print_r($role,
true));
443 if(substr($role[
'title'],0,3) !=
'il_')
445 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot revert local policy for role '. $role[
'title']);
451 if(!$rbacreview->getLocalPolicies($source->
getRefId()))
456 $exploded_title = explode(
'_',$role[
'title']);
457 $rolt_title = $exploded_title[0].
'_'.$exploded_title[1].
'_'.$exploded_title[2];
460 $query =
'SELECT obj_id FROM object_data '.
461 'WHERE title = '.$ilDB->quote($rolt_title,
'text').
' '.
462 'AND type = '.$ilDB->quote(
'rolt',
'text');
466 $rolt_id =
$row->obj_id;
475 $rbacadmin->copyRoleTemplatePermissions(
484 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
485 $role_obj =
new ilObjRole($role[
'obj_id']);
486 $role_obj->changeExistingObjects(