ILIAS  release_4-4 Revision
ilObjRole Class Reference

Class ilObjRole. More...

+ Inheritance diagram for ilObjRole:
+ Collaboration diagram for ilObjRole:

Public Member Functions

 ilObjRole ($a_id=0, $a_call_by_reference=false)
 Constructor public. More...
 
 validate ()
 Validate role data. More...
 
 getPresentationTitle ()
 return translated title for autogenerated roles More...
 
 toggleAssignUsersStatus ($a_assign_users)
 
 getAssignUsersStatus ()
 
 _getAssignUsersStatus ($a_role_id)
 
 read ()
 loads "role" from database private More...
 
 assignData ($a_data)
 loads a record "role" from array public More...
 
 update ()
 updates a record "role" and write it into database public More...
 
 create ()
 create More...
 
 setAllowRegister ($a_allow_register)
 set allow_register of role More...
 
 getAllowRegister ()
 get allow_register More...
 
 setDiskQuota ($a_disk_quota)
 Sets the minimal disk quota imposed by this role. More...
 
 getDiskQuota ()
 Gets the minimal disk quota imposed by this role. More...
 
 setPersonalWorkspaceDiskQuota ($a_disk_quota)
 Sets the minimal personal workspace disk quota imposed by this role. More...
 
 getPersonalWorkspaceDiskQuota ()
 Gets the minimal personal workspace disk quota imposed by this role. More...
 
 _lookupRegisterAllowed ()
 get all roles that are activated in user registration More...
 
 _lookupAllowRegister ($a_role_id)
 check whether role is allowed in user registration or not More...
 
 setParent ($a_parent_ref)
 set reference id of parent object this is neccessary for non RBAC protected objects!!! More...
 
 getParent ()
 get reference id of parent object More...
 
 delete ()
 delete role and all related data More...
 
 getCountMembers ()
 
 _getTranslation ($a_role_title)
 
 _updateAuthMode ($a_roles)
 
 _getAuthMode ($a_role_id)
 
 __getPermissionDefinitions ()
 
 isDeletable ($a_role_folder_id)
 Check whether a role is deletable (non autogenereated role and defined) at this position Does not perform permission checks. More...
 
 changeExistingObjects ($a_start_node, $a_mode, $a_filter, $a_exclusion_filter=array())
 Change existing objects. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static _getRolesByAuthMode ($a_auth_mode)
 Get roles by auth mode. More...
 
static _resetAuthMode ($a_auth_mode)
 Reset auth mode to default. More...
 
static isAutoGenerated ($a_role_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const MODE_PROTECTED_DELETE_LOCAL_POLICIES = 1
 
const MODE_PROTECTED_KEEP_LOCAL_POLICIES = 2
 
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES = 3
 
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES = 4
 
 $parent
 
 $allow_register
 
 $assign_users
 
 $disk_quota
 The disk quota in bytes. More...
 
 $wsp_disk_quota
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

 deleteLocalPolicies ($a_start, $a_policies, $a_filter)
 Delete local policies. More...
 
 adjustPermissions ($a_mode, $a_nodes, $a_policies, $a_filter, $a_exclusion_filter=array())
 Adjust permissions. More...
 
 isHandledObjectType ($a_filter, $a_exclusion_filter, $a_type)
 Check if type is filterer. More...
 
 updateOperationStack (&$a_stack, $a_node, $a_init=false)
 Update operation stack. More...
 
 updatePolicyStack (&$a_stack, $a_node)
 Update policy stack. More...
 
 createPermissionIntersection ($policy_stack, $a_current_ops, $a_id, $a_type)
 Create course group permission intersection. More...
 

Detailed Description

Class ilObjRole.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilObjRole.php.

Member Function Documentation

◆ __getPermissionDefinitions()

ilObjRole::__getPermissionDefinitions ( )

Definition at line 561 of file class.ilObjRole.php.

References ilObject\$lng, and ilPlugin\lookupTxt().

562  {
563  global $ilDB, $lng, $objDefinition,$rbacreview;
564 
565  $operation_info = $rbacreview->getOperationAssignment();
566  foreach($operation_info as $info)
567  {
568  if($objDefinition->getDevMode($info['type']))
569  {
570  continue;
571  }
572  $rbac_objects[$info['typ_id']] = array("obj_id" => $info['typ_id'],
573  "type" => $info['type']);
574 
575  // handle plugin permission texts
576  $txt = $objDefinition->isPlugin($info['type'])
577  ? ilPlugin::lookupTxt("rep_robj", $info['type'], $info['type']."_".$info['operation'])
578  : $lng->txt($info['type']."_".$info['operation']);
579  if (substr($info['operation'], 0, 7) == "create_" &&
580  $objDefinition->isPlugin(substr($info['operation'], 7)))
581  {
582  $txt = ilPlugin::lookupTxt("rep_robj", substr($info['operation'], 7), $info['type']."_".$info['operation']);
583  }
584  $rbac_operations[$info['typ_id']][$info['ops_id']] = array(
585  "ops_id" => $info['ops_id'],
586  "title" => $info['operation'],
587  "name" => $txt);
588 
589  }
590  return array($rbac_objects,$rbac_operations);
591  }
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
+ Here is the call graph for this function:

◆ _getAssignUsersStatus()

ilObjRole::_getAssignUsersStatus (   $a_role_id)

Definition at line 86 of file class.ilObjRole.php.

References $query, $res, and $row.

Referenced by ilRbacReview\getGlobalAssignableRoles(), ilObjUserFolderGUI\importUserRoleAssignmentObject(), ilSoapUserAdministration\importUsers(), ilObjUserFolderGUI\importUsersObject(), ilObjUserGUI\initCreate(), and ilSoapUserAdministration\isPermittedRole().

87  {
88  global $ilDB;
89 
90  $query = "SELECT assign_users FROM role_data WHERE role_id = ".$ilDB->quote($a_role_id,'integer')." ";
91  $res = $ilDB->query($query);
92  while($row = $ilDB->fetchObject($res))
93  {
94  return $row->assign_users ? true : false;
95  }
96  return false;
97  }
+ Here is the caller graph for this function:

◆ _getAuthMode()

ilObjRole::_getAuthMode (   $a_role_id)

Definition at line 509 of file class.ilObjRole.php.

References $query, $res, and $row.

510  {
511  global $ilDB;
512 
513  $query = "SELECT auth_mode FROM role_data ".
514  "WHERE role_id= ".$ilDB->quote($a_role_id,'integer')." ";
515  $res = $ilDB->query($query);
516  $row = $ilDB->fetchAssoc($res);
517 
518  return $row['auth_mode'];
519  }

◆ _getRolesByAuthMode()

static ilObjRole::_getRolesByAuthMode (   $a_auth_mode)
static

Get roles by auth mode.

public

Parameters
stringauth mode

Definition at line 528 of file class.ilObjRole.php.

References $query, $res, and $row.

Referenced by ilRadiusSettings\read().

529  {
530  global $ilDB;
531 
532  $query = "SELECT * FROM role_data ".
533  "WHERE auth_mode = ".$ilDB->quote($a_auth_mode,'text');
534  $res = $ilDB->query($query);
535  $roles = array();
536  while($row = $ilDB->fetchObject($res))
537  {
538  $roles[] = $row->role_id;
539  }
540  return $roles;
541  }
+ Here is the caller graph for this function:

◆ _getTranslation()

◆ _lookupAllowRegister()

ilObjRole::_lookupAllowRegister (   $a_role_id)

check whether role is allowed in user registration or not

Parameters
int$a_role_idrole id
Returns
boolean true if role is allowed in user registration

Definition at line 304 of file class.ilObjRole.php.

References $query, and $res.

Referenced by ilRegistrationSettingsGUI\editRoles(), and ilAccountRegistrationGUI\saveForm().

305  {
306  global $ilDB;
307 
308  $query = "SELECT * FROM role_data ".
309  " WHERE role_id =".$ilDB->quote($a_role_id,'integer');
310 
311  $res = $ilDB->query($query);
312  if ($role_rec = $ilDB->fetchAssoc($res))
313  {
314  if ($role_rec["allow_register"])
315  {
316  return true;
317  }
318  }
319  return false;
320  }
+ Here is the caller graph for this function:

◆ _lookupRegisterAllowed()

ilObjRole::_lookupRegisterAllowed ( )

get all roles that are activated in user registration

public

Returns
array array of int: role ids

Definition at line 278 of file class.ilObjRole.php.

References $query, and $res.

Referenced by ilRegistrationSettingsGUI\__prepareAccessLimitationRoleList(), ilRegistrationSettingsGUI\__prepareRoleList(), ilShopUtils\_createRandomUserAccount(), ilUserProfile\addStandardFieldsToForm(), ilObjAuthSettingsGUI\authSettingsObject(), ilRegistrationSettingsGUI\editRoleAccessLimitations(), and ilRegistrationSettingsGUI\saveRoleAccessLimitations().

279  {
280  global $ilDB;
281 
282  $query = "SELECT * FROM role_data ".
283  "JOIN object_data ON object_data.obj_id = role_data.role_id ".
284  "WHERE allow_register = 1";
285  $res = $ilDB->query($query);
286 
287  $roles = array();
288  while($role = $ilDB->fetchAssoc($res))
289  {
290  $roles[] = array("id" => $role["obj_id"],
291  "title" => $role["title"],
292  "auth_mode" => $role['auth_mode']);
293  }
294 
295  return $roles;
296  }
+ Here is the caller graph for this function:

◆ _resetAuthMode()

static ilObjRole::_resetAuthMode (   $a_auth_mode)
static

Reset auth mode to default.

public

Parameters
stringauth mode

Definition at line 551 of file class.ilObjRole.php.

References $query, and $res.

Referenced by ilRadiusSettings\save().

552  {
553  global $ilDB;
554 
555  $query = "UPDATE role_data SET auth_mode = 'default' WHERE auth_mode = ".$ilDB->quote($a_auth_mode,'text');
556  $res = $ilDB->manipulate($query);
557  }
+ Here is the caller graph for this function:

◆ _updateAuthMode()

ilObjRole::_updateAuthMode (   $a_roles)

Definition at line 496 of file class.ilObjRole.php.

References $query, and $res.

Referenced by ilRadiusSettings\save(), and ilObjAuthSettingsGUI\updateAuthRolesObject().

497  {
498  global $ilDB;
499 
500  foreach ($a_roles as $role_id => $auth_mode)
501  {
502  $query = "UPDATE role_data SET ".
503  "auth_mode= ".$ilDB->quote($auth_mode,'text')." ".
504  "WHERE role_id= ".$ilDB->quote($role_id,'integer')." ";
505  $res = $ilDB->manipulate($query);
506  }
507  }
+ Here is the caller graph for this function:

◆ adjustPermissions()

ilObjRole::adjustPermissions (   $a_mode,
  $a_nodes,
  $a_policies,
  $a_filter,
  $a_exclusion_filter = array() 
)
protected

Adjust permissions.

Parameters
int$a_mode
array$a_nodesarray of nodes
array$a_policiesarray of object ref ids
array$a_exclusion_filterof object types.
Returns

Definition at line 702 of file class.ilObjRole.php.

References $GLOBALS, ilRbacLog\add(), createPermissionIntersection(), ilRbacLog\diffFaPa(), ilRbacLog\EDIT_TEMPLATE_EXISTING, ilRbacLog\gatherFaPa(), ilObject\getId(), ilRbacLog\isActive(), isHandledObjectType(), ilTree\RELATION_CHILD, ilTree\RELATION_EQUALS, ilTree\RELATION_NONE, ilTree\RELATION_PARENT, ilTree\RELATION_SIBLING, updateOperationStack(), and updatePolicyStack().

Referenced by changeExistingObjects().

703  {
704  global $rbacadmin, $rbacreview, $tree;
705 
706  $operation_stack = array();
707  $policy_stack = array();
708  $node_stack = array();
709 
710  $start_node = current($a_nodes);
711  array_push($node_stack,$start_node);
712  $this->updatePolicyStack($policy_stack, $start_node['child']);
713  $this->updateOperationStack($operation_stack, $start_node['child'],true);
714 
715  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
716  $rbac_log_active = ilRbacLog::isActive();
717 
718  $local_policy = false;
719  foreach($a_nodes as $node)
720  {
721  $cmp_node = end($node_stack);
722  while($relation = $tree->getRelationOfNodes($node,$cmp_node))
723  {
724  switch($relation)
725  {
728  $GLOBALS['ilLog']->write(__METHOD__.': Handling sibling/none relation.');
729  array_pop($operation_stack);
730  array_pop($policy_stack);
731  array_pop($node_stack);
732  $cmp_node = end($node_stack);
733  $local_policy = false;
734  break;
735 
739  default:
740  $GLOBALS['ilLog']->write(__METHOD__.': Handling child/equals/parent '. $relation);
741  break 2;
742  }
743 
744  }
745 
746  if($local_policy)
747  {
748  continue;
749  }
750 
751  // Start node => set permissions and continue
752  if($node['child'] == $start_node['child'])
753  {
754  if($this->isHandledObjectType($a_filter,$a_exclusion_filter,$node['type']))
755  {
756  if($rbac_log_active)
757  {
758  $rbac_log_roles = $rbacreview->getParentRoleIds($node['child'], false);
759  $rbac_log_old = ilRbacLog::gatherFaPa($node['child'], array_keys($rbac_log_roles));
760  }
761 
762  // Set permissions
763  $perms = end($operation_stack);
764  $rbacadmin->grantPermission(
765  $this->getId(),
766  (array) $perms[$node['type']],
767  $node['child']
768  );
769 
770  if($rbac_log_active)
771  {
772  $rbac_log_new = ilRbacLog::gatherFaPa($node['child'], array_keys($rbac_log_roles));
773  $rbac_log = ilRbacLog::diffFaPa($rbac_log_old, $rbac_log_new);
774  ilRbacLog::add(ilRbacLog::EDIT_TEMPLATE_EXISTING, $node['child'], $rbac_log);
775  }
776  }
777  continue;
778  }
779 
780  // Node has local policies => update permission stack and continue
781  if(in_array($node['child'], $a_policies) and ($node['child'] != SYSTEM_FOLDER_ID))
782  {
783  $local_policy = true;
784  $this->updatePolicyStack($policy_stack, $node['child']);
785  $this->updateOperationStack($operation_stack, $node['child']);
786  array_push($node_stack, $node);
787  continue;
788  }
789 
790  // Continue if this object type is not in filter
791  if(!$this->isHandledObjectType($a_filter,$a_exclusion_filter,$node['type']))
792  {
793  continue;
794  }
795 
796  if($rbac_log_active)
797  {
798  $rbac_log_roles = $rbacreview->getParentRoleIds($node['child'], false);
799  $rbac_log_old = ilRbacLog::gatherFaPa($node['child'], array_keys($rbac_log_roles));
800  }
801 
802  // Node is course => create course permission intersection
803  if(($a_mode == self::MODE_UNPROTECTED_DELETE_LOCAL_POLICIES or
804  $a_mode == self::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES) and ($node['type'] == 'crs'))
805 
806  {
807  // Copy role permission intersection
808  $perms = end($operation_stack);
809  $this->createPermissionIntersection($policy_stack,$perms['crs'],$node['child'],$node['type']);
810  if($this->updateOperationStack($operation_stack,$node['child']))
811  {
812  $this->updatePolicyStack($policy_stack, $node['child']);
813  array_push($node_stack, $node);
814  }
815  }
816 
817  // Node is group => create group permission intersection
818  if(($a_mode == self::MODE_UNPROTECTED_DELETE_LOCAL_POLICIES or
819  $a_mode == self::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES) and ($node['type'] == 'grp'))
820  {
821  // Copy role permission intersection
822  $perms = end($operation_stack);
823  $this->createPermissionIntersection($policy_stack,$perms['grp'],$node['child'],$node['type']);
824  if($this->updateOperationStack($operation_stack,$node['child']))
825  {
826  $this->updatePolicyStack($policy_stack, $node['child']);
827  array_push($node_stack, $node);
828  }
829  }
830 
831  // Set permission
832  $perms = end($operation_stack);
833  $rbacadmin->grantPermission(
834  $this->getId(),
835  (array) $perms[$node['type']],
836  $node['child']
837  );
838 
839  if($rbac_log_active)
840  {
841  $rbac_log_new = ilRbacLog::gatherFaPa($node['child'], array_keys($rbac_log_roles));
842  $rbac_log = ilRbacLog::diffFaPa($rbac_log_old, $rbac_log_new);
843  ilRbacLog::add(ilRbacLog::EDIT_TEMPLATE_EXISTING, $node['child'], $rbac_log);
844  }
845  }
846  }
createPermissionIntersection($policy_stack, $a_current_ops, $a_id, $a_type)
Create course group permission intersection.
const RELATION_PARENT
static isActive()
updatePolicyStack(&$a_stack, $a_node)
Update policy stack.
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
static diffFaPa(array $a_old, array $a_new)
getId()
get object id public
$GLOBALS['ct_recipient']
isHandledObjectType($a_filter, $a_exclusion_filter, $a_type)
Check if type is filterer.
const RELATION_EQUALS
const RELATION_CHILD
const RELATION_NONE
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
const EDIT_TEMPLATE_EXISTING
updateOperationStack(&$a_stack, $a_node, $a_init=false)
Update operation stack.
const RELATION_SIBLING
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignData()

ilObjRole::assignData (   $a_data)

loads a record "role" from array public

Parameters
arrayroledata

Definition at line 130 of file class.ilObjRole.php.

References setAllowRegister(), ilObject\setDescription(), setDiskQuota(), setPersonalWorkspaceDiskQuota(), ilObject\setTitle(), ilUtil\stripSlashes(), and toggleAssignUsersStatus().

Referenced by read().

131  {
132  $this->setTitle(ilUtil::stripSlashes($a_data["title"]));
133  $this->setDescription(ilUtil::stripslashes($a_data["desc"]));
134  $this->setAllowRegister($a_data["allow_register"]);
135  $this->toggleAssignUsersStatus($a_data['assign_users']);
136  $this->setDiskQuota($a_data['disk_quota']);
137  $this->setPersonalWorkspaceDiskQuota($a_data['wsp_disk_quota']);
138  }
toggleAssignUsersStatus($a_assign_users)
setAllowRegister($a_allow_register)
set allow_register of role
setTitle($a_title)
set object title
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setPersonalWorkspaceDiskQuota($a_disk_quota)
Sets the minimal personal workspace disk quota imposed by this role.
setDescription($a_desc)
set object description
setDiskQuota($a_disk_quota)
Sets the minimal disk quota imposed by this role.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeExistingObjects()

ilObjRole::changeExistingObjects (   $a_start_node,
  $a_mode,
  $a_filter,
  $a_exclusion_filter = array() 
)

Change existing objects.

Parameters
int$a_start_node
int$a_mode
arrayfilter Filter of object types (array('all') => change all objects
Returns

Definition at line 627 of file class.ilObjRole.php.

References adjustPermissions(), deleteLocalPolicies(), and ilObject\getId().

628  {
629  global $tree,$rbacreview;
630 
631  // Get node info of subtree
632  $nodes = $tree->getRbacSubtreeInfo($a_start_node);
633 
634 
635  // get local policies
636  $all_local_policies = $rbacreview->getObjectsWithStopedInheritance($this->getId());
637 
638  // filter relevant roles
639  $local_policies = array();
640  foreach($all_local_policies as $lp)
641  {
642  if(isset($nodes[$lp]))
643  {
644  $local_policies[] = $lp;
645  }
646  }
647 
648  // Delete deprecated policies
649  switch($a_mode)
650  {
651  case self::MODE_UNPROTECTED_DELETE_LOCAL_POLICIES:
652  case self::MODE_PROTECTED_DELETE_LOCAL_POLICIES:
653  $local_policies = $this->deleteLocalPolicies($a_start_node,$local_policies,$a_filter);
654  #$local_policies = array($a_start_node == ROOT_FOLDER_ID ? SYSTEM_FOLDER_ID : $a_start_node);
655  break;
656  }
657  $this->adjustPermissions($a_mode,$nodes,$local_policies,$a_filter,$a_exclusion_filter);
658 
659  #var_dump(memory_get_peak_usage());
660  #var_dump(memory_get_usage());
661  }
deleteLocalPolicies($a_start, $a_policies, $a_filter)
Delete local policies.
getId()
get object id public
adjustPermissions($a_mode, $a_nodes, $a_policies, $a_filter, $a_exclusion_filter=array())
Adjust permissions.
+ Here is the call graph for this function:

◆ create()

ilObjRole::create ( )

create

public

Returns
integer object id

Definition at line 170 of file class.ilObjRole.php.

References ilObject\$id, $query, $res, getAllowRegister(), getAssignUsersStatus(), getDiskQuota(), and getPersonalWorkspaceDiskQuota().

171  {
172  global $ilDB;
173 
174  $this->id = parent::create();
175 
176  $query = "INSERT INTO role_data ".
177  "(role_id,allow_register,assign_users,disk_quota,wsp_disk_quota) ".
178  "VALUES ".
179  "(".$ilDB->quote($this->id,'integer').",".
180  $ilDB->quote($this->getAllowRegister(),'integer').",".
181  $ilDB->quote($this->getAssignUsersStatus(),'integer').",".
182  $ilDB->quote($this->getDiskQuota(),'integer').",".
183  $ilDB->quote($this->getPersonalWorkspaceDiskQuota(),'integer').")"
184  ;
185  $res = $ilDB->query($query);
186 
187  return $this->id;
188  }
getPersonalWorkspaceDiskQuota()
Gets the minimal personal workspace disk quota imposed by this role.
getAllowRegister()
get allow_register
getDiskQuota()
Gets the minimal disk quota imposed by this role.
+ Here is the call graph for this function:

◆ createPermissionIntersection()

ilObjRole::createPermissionIntersection (   $policy_stack,
  $a_current_ops,
  $a_id,
  $a_type 
)
protected

Create course group permission intersection.

Parameters
arrayoperation stack
int$a_id
string$a_type
Returns

Definition at line 946 of file class.ilObjRole.php.

References $GLOBALS, $query, $res, $row, ilObject\$type, ilObject\_lookupObjId(), DB_FETCHMODE_OBJECT, ilObject\getId(), GRP_TYPE_CLOSED, GRP_TYPE_OPEN, and ilObjGroup\lookupGroupTye().

Referenced by adjustPermissions().

947  {
948  global $ilDB, $rbacreview,$rbacadmin;
949 
950  static $course_non_member_id = null;
951  static $group_non_member_id = null;
952  static $group_open_id = null;
953  static $group_closed_id = null;
954 
955  // Get template id
956  switch($a_type)
957  {
958  case 'grp':
959 
960  include_once './Modules/Group/classes/class.ilObjGroup.php';
962  #var_dump("GROUP TYPE",$type);
963  switch($type)
964  {
965  case GRP_TYPE_CLOSED:
966  if(!$group_closed_id)
967  {
968  $query = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_closed'";
969  $res = $ilDB->query($query);
970  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
971  {
972  $group_closed_id = $row->obj_id;
973  }
974  }
975  $template_id = $group_closed_id;
976  #var_dump("GROUP CLOSED id:" . $template_id);
977  break;
978 
979  case GRP_TYPE_OPEN:
980  default:
981  if(!$group_open_id)
982  {
983  $query = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_open'";
984  $res = $ilDB->query($query);
985  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
986  {
987  $group_open_id = $row->obj_id;
988  }
989  }
990  $template_id = $group_open_id;
991  #var_dump("GROUP OPEN id:" . $template_id);
992  break;
993  }
994  break;
995 
996  case 'crs':
997  if(!$course_non_member_id)
998  {
999  $query = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1000  $res = $ilDB->query($query);
1001  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1002  {
1003  $course_non_member_id = $row->obj_id;
1004  }
1005  }
1006  $template_id = $course_non_member_id;
1007  break;
1008  }
1009 
1010  $current_ops = $a_current_ops[$a_type];
1011 
1012  // Create intersection template permissions
1013  if($template_id)
1014  {
1015  $rolf = $rbacreview->getRoleFolderIdOfObject($a_id);
1016 
1017  $rbacadmin->copyRolePermissionIntersection(
1018  $template_id, ROLE_FOLDER_ID,
1019  $this->getId(), end($policy_stack),
1020  $rolf,$this->getId()
1021  );
1022  }
1023  else
1024  {
1025  #echo "No template id for ".$a_id.' of type'.$a_type.'<br>';
1026  }
1027  #echo "ROLE ASSIGN: ".$rolf.' AID'.$a_id;
1028  if($rolf and !$GLOBALS['rbacreview']->isRoleAssignedToFolder($this->getId(),$rolf))
1029  {
1030  $rbacadmin->assignRoleToFolder($this->getId(),$rolf,"n");
1031  }
1032  return true;
1033  }
const GRP_TYPE_OPEN
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getId()
get object id public
$GLOBALS['ct_recipient']
const GRP_TYPE_CLOSED
static _lookupObjId($a_id)
static lookupGroupTye($a_id)
Lookup group type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjRole::delete ( )

delete role and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

Definition at line 352 of file class.ilObjRole.php.

References $GLOBALS, $query, $res, ilLDAPRoleGroupMappingSettings\_deleteByRole(), ilObject\_exists(), ilObject\getId(), and getParent().

353  {
354  global $rbacadmin, $rbacreview,$ilDB;
355 
356  $role_folders = $rbacreview->getFoldersAssignedToRole($this->getId());
357 
358  // Temporary bugfix
359  if($rbacreview->hasMultipleAssignments($this->getId()))
360  {
361  $GLOBALS['ilLog']->write(__METHOD__.': Found role with multiple assignments: '.$this->getId());
362  return false;
363  }
364 
365  if ($rbacreview->isAssignable($this->getId(),$this->getParent()))
366  {
367  // do not delete a global role, if the role is the last
368  // role a user is assigned to.
369  //
370  // Performance improvement: In the code section below, we
371  // only need to consider _global_ roles. We don't need
372  // to check for _local_ roles, because a user who has
373  // a local role _always_ has a global role too.
374  $last_role_user_ids = array();
375  if ($this->getParent() == ROLE_FOLDER_ID)
376  {
377  // The role is a global role: check if
378  // we find users who aren't assigned to any
379  // other global role than this one.
380  $user_ids = $rbacreview->assignedUsers($this->getId());
381 
382  foreach ($user_ids as $user_id)
383  {
384  // get all roles each user has
385  $role_ids = $rbacreview->assignedRoles($user_id);
386 
387  // is last role?
388  if (count($role_ids) == 1)
389  {
390  $last_role_user_ids[] = $user_id;
391  }
392  }
393  }
394 
395  // users with last role found?
396  if (count($last_role_user_ids) > 0)
397  {
398  foreach ($last_role_user_ids as $user_id)
399  {
400 //echo "<br>last role for user id:".$user_id.":";
401  // GET OBJECT TITLE
402  $tmp_obj = $this->ilias->obj_factory->getInstanceByObjId($user_id);
403  $user_names[] = $tmp_obj->getFullname();
404  unset($tmp_obj);
405  }
406 
407  // TODO: This check must be done in rolefolder object because if multiple
408  // roles were selected the other roles are still deleted and the system does not
409  // give any feedback about this.
410  $users = implode(', ',$user_names);
411  $this->ilias->raiseError($this->lng->txt("msg_user_last_role1")." ".
412  $users."<br/>".$this->lng->txt("msg_user_last_role2"),$this->ilias->error_obj->WARNING);
413  }
414  else
415  {
416  // IT'S A BASE ROLE
417  $rbacadmin->deleteRole($this->getId(),$this->getParent());
418 
419  // Delete ldap role group mappings
420  include_once('./Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php');
422 
423  // delete object_data entry
424  parent::delete();
425 
426  // delete role_data entry
427  $query = "DELETE FROM role_data WHERE role_id = ".$ilDB->quote($this->getId(),'integer');
428  $res = $ilDB->manipulate($query);
429 
430  include_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
431  $role_desk_item_obj = new ilRoleDesktopItem($this->getId());
432  $role_desk_item_obj->deleteAll();
433 
434  }
435  }
436  else
437  {
438  // linked local role: INHERITANCE WAS STOPPED, SO DELETE ONLY THIS LOCAL ROLE
439  $rbacadmin->deleteLocalRole($this->getId(),$this->getParent());
440  }
441 
442  // purge empty rolefolders
443  //
444  // Performance improvement: We filter out all role folders
445  // which still contain roles, _before_ we attempt to purge them.
446  // This is faster than attempting to purge all role folders,
447  // and let function purge() of the role folder find out, if
448  // purging is possible.
449 
450  $non_empty_role_folders = $rbacreview->filterEmptyRoleFolders($role_folders);
451  $role_folders = array_diff($role_folders,$non_empty_role_folders);
452 
453  // Attempt to purge the role folders
454  foreach ($role_folders as $rolf)
455  {
456  if (ilObject::_exists($rolf,true))
457  {
458  $rolfObj = $this->ilias->obj_factory->getInstanceByRefId($rolf);
459  $rolfObj->purge();
460  unset($rolfObj);
461  }
462  }
463 
464  return true;
465  }
Class ilObjRoleGUI.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
getId()
get object id public
$GLOBALS['ct_recipient']
redirection script todo: (a better solution should control the processing via a xml file) ...
getParent()
get reference id of parent object
+ Here is the call graph for this function:

◆ deleteLocalPolicies()

ilObjRole::deleteLocalPolicies (   $a_start,
  $a_policies,
  $a_filter 
)
protected

Delete local policies.

Parameters
array$a_policiesarray of object ref ids that define local policies
Returns

Definition at line 668 of file class.ilObjRole.php.

References ilObject\_lookupObjId(), ilObject\_lookupType(), and ilObject\getId().

Referenced by changeExistingObjects().

669  {
670  global $rbacreview,$rbacadmin;
671 
672  $local_policies = array();
673  foreach($a_policies as $policy)
674  {
675  if($policy == $a_start or $policy == SYSTEM_FOLDER_ID)
676  {
677  $local_policies[] = $policy;
678  continue;
679  }
680  if(!in_array('all',$a_filter) and !in_array(ilObject::_lookupType(ilObject::_lookupObjId($policy)),$a_filter))
681  {
682  $local_policies[] = $policy;
683  continue;
684  }
685 
686  if($rolf = $rbacreview->getRoleFolderIdOfObject($policy))
687  {
688  $rbacadmin->deleteLocalRole($this->getId(),$rolf);
689  }
690  }
691  return $local_policies;
692  }
getId()
get object id public
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAllowRegister()

ilObjRole::getAllowRegister ( )

get allow_register

public

Returns
integer

Definition at line 212 of file class.ilObjRole.php.

Referenced by create(), and ilObjRoleGUI\readRoleProperties().

213  {
214  return $this->allow_register ? $this->allow_register : false;
215  }
+ Here is the caller graph for this function:

◆ getAssignUsersStatus()

ilObjRole::getAssignUsersStatus ( )

Definition at line 81 of file class.ilObjRole.php.

Referenced by create(), ilObjRoleGUI\readRoleProperties(), and update().

82  {
83  return $this->assign_users ? $this->assign_users : 0;
84  }
+ Here is the caller graph for this function:

◆ getCountMembers()

ilObjRole::getCountMembers ( )

Definition at line 467 of file class.ilObjRole.php.

468  {
469  global $rbacreview;
470 
471  return count($rbacreview->assignedUsers($this->getId()));
472  }

◆ getDiskQuota()

ilObjRole::getDiskQuota ( )

Gets the minimal disk quota imposed by this role.

Returns the minimal disk quota in bytes. The default value is 0.

public

Returns
integer

Definition at line 239 of file class.ilObjRole.php.

References $disk_quota.

Referenced by create(), ilObjRoleGUI\readRoleProperties(), and update().

240  {
241  return $this->disk_quota;
242  }
$disk_quota
The disk quota in bytes.
+ Here is the caller graph for this function:

◆ getParent()

ilObjRole::getParent ( )

get reference id of parent object

public

Returns
integer ref_id of parent object

Definition at line 340 of file class.ilObjRole.php.

References $parent.

Referenced by delete().

341  {
342  return $this->parent;
343  }
+ Here is the caller graph for this function:

◆ getPersonalWorkspaceDiskQuota()

ilObjRole::getPersonalWorkspaceDiskQuota ( )

Gets the minimal personal workspace disk quota imposed by this role.

Returns the minimal disk quota in bytes. The default value is 0.

public

Returns
integer

Definition at line 267 of file class.ilObjRole.php.

References $wsp_disk_quota.

Referenced by create(), ilObjRoleGUI\readRoleProperties(), and update().

268  {
269  return $this->wsp_disk_quota;
270  }
+ Here is the caller graph for this function:

◆ getPresentationTitle()

ilObjRole::getPresentationTitle ( )

return translated title for autogenerated roles

Returns

Definition at line 72 of file class.ilObjRole.php.

References _getTranslation(), and ilObject\getTitle().

73  {
74  return ilObjRole::_getTranslation($this->getTitle());
75  }
_getTranslation($a_role_title)
getTitle()
get object title public
+ Here is the call graph for this function:

◆ ilObjRole()

ilObjRole::ilObjRole (   $a_id = 0,
  $a_call_by_reference = false 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 44 of file class.ilObjRole.php.

References ilObject\ilObject().

45  {
46  $this->type = "role";
47  $this->disk_quota = 0;
48  $this->wsp_disk_quota = 0;
49  $this->ilObject($a_id,$a_call_by_reference);
50  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
+ Here is the call graph for this function:

◆ isAutoGenerated()

static ilObjRole::isAutoGenerated (   $a_role_id)
static

Definition at line 615 of file class.ilObjRole.php.

References ilObject\_lookupTitle().

Referenced by ilObjRoleGUI\initFormRoleProperties().

616  {
617  return substr(ilObject::_lookupTitle($a_role_id), 0, 3) == 'il_';
618  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDeletable()

ilObjRole::isDeletable (   $a_role_folder_id)

Check whether a role is deletable (non autogenereated role and defined) at this position Does not perform permission checks.

Returns
bool

Definition at line 598 of file class.ilObjRole.php.

References ilObject\getTitle().

599  {
600  global $rbacreview;
601 
602  if(!$rbacreview->isAssignable($this->getId(), $a_role_folder_id))
603  {
604  return false;
605  }
606 
607  if(substr($this->getTitle(),0,3) == 'il_')
608  {
609  return false;
610  }
611  return true;
612 
613  }
getTitle()
get object title public
+ Here is the call graph for this function:

◆ isHandledObjectType()

ilObjRole::isHandledObjectType (   $a_filter,
  $a_exclusion_filter,
  $a_type 
)
protected

Check if type is filterer.

Parameters
array$a_filter
string$a_type
Returns

Definition at line 854 of file class.ilObjRole.php.

Referenced by adjustPermissions().

855  {
856  if(in_array($a_type,$a_exclusion_filter))
857  {
858  return false;
859  }
860 
861  if(in_array('all',$a_filter))
862  {
863  return true;
864  }
865  return in_array($a_type,$a_filter);
866  }
+ Here is the caller graph for this function:

◆ read()

ilObjRole::read ( )

loads "role" from database private

Definition at line 103 of file class.ilObjRole.php.

References $data, $query, $res, assignData(), and ilDB\fetchAssoc().

Referenced by update().

104  {
105  global $ilDB;
106 
107  $query = "SELECT * FROM role_data WHERE role_id= ".$ilDB->quote($this->id,'integer')." ";
108 
109  $res = $ilDB->query($query);
110  if ($res->numRows() > 0)
111  {
112  $data = $ilDB->fetchAssoc($res);
113 
114  // fill member vars in one shot
115  $this->assignData($data);
116  }
117  else
118  {
119  $this->ilias->raiseError("<b>Error: There is no dataset with id ".$this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__."<br />Line: ".__LINE__, $this->ilias->FATAL);
120  }
121 
122  parent::read();
123  }
fetchAssoc($a_set)
Fetch row as associative array from result set.
redirection script todo: (a better solution should control the processing via a xml file) ...
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
assignData($a_data)
loads a record "role" from array public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllowRegister()

ilObjRole::setAllowRegister (   $a_allow_register)

set allow_register of role

public

Parameters
integer

Definition at line 196 of file class.ilObjRole.php.

Referenced by assignData(), and ilObjRoleGUI\loadRoleProperties().

197  {
198  if (empty($a_allow_register))
199  {
200  $a_allow_register == 0;
201  }
202 
203  $this->allow_register = (int) $a_allow_register;
204  }
+ Here is the caller graph for this function:

◆ setDiskQuota()

ilObjRole::setDiskQuota (   $a_disk_quota)

Sets the minimal disk quota imposed by this role.

The minimal disk quota is specified in bytes.

@access     public
@param      integer 

Definition at line 225 of file class.ilObjRole.php.

Referenced by assignData(), and ilObjRoleGUI\loadRoleProperties().

226  {
227  $this->disk_quota = $a_disk_quota;
228  }
+ Here is the caller graph for this function:

◆ setParent()

ilObjRole::setParent (   $a_parent_ref)

set reference id of parent object this is neccessary for non RBAC protected objects!!!

public

Parameters
integerref_id of parent object

Definition at line 329 of file class.ilObjRole.php.

330  {
331  $this->parent = $a_parent_ref;
332  }

◆ setPersonalWorkspaceDiskQuota()

ilObjRole::setPersonalWorkspaceDiskQuota (   $a_disk_quota)

Sets the minimal personal workspace disk quota imposed by this role.

The minimal disk quota is specified in bytes.

@access     public
@param      integer 

Definition at line 253 of file class.ilObjRole.php.

Referenced by assignData(), and ilObjRoleGUI\loadRoleProperties().

254  {
255  $this->wsp_disk_quota = $a_disk_quota;
256  }
+ Here is the caller graph for this function:

◆ toggleAssignUsersStatus()

ilObjRole::toggleAssignUsersStatus (   $a_assign_users)

Definition at line 77 of file class.ilObjRole.php.

Referenced by assignData(), and ilObjRoleGUI\loadRoleProperties().

78  {
79  $this->assign_users = (int) $a_assign_users;
80  }
+ Here is the caller graph for this function:

◆ update()

ilObjRole::update ( )

updates a record "role" and write it into database public

Definition at line 144 of file class.ilObjRole.php.

References $query, $res, getAssignUsersStatus(), getDiskQuota(), getPersonalWorkspaceDiskQuota(), and read().

145  {
146  global $ilDB;
147 
148  $query = "UPDATE role_data SET ".
149  "allow_register= ".$ilDB->quote($this->allow_register,'integer').", ".
150  "assign_users = ".$ilDB->quote($this->getAssignUsersStatus(),'integer').", ".
151  "disk_quota = ".$ilDB->quote($this->getDiskQuota(),'integer').", ".
152  "wsp_disk_quota = ".$ilDB->quote($this->getPersonalWorkspaceDiskQuota(),'integer')." ".
153  "WHERE role_id= ".$ilDB->quote($this->id,'integer')." ";
154  $res = $ilDB->manipulate($query);
155 
156  parent::update();
157 
158  $this->read();
159 
160  return true;
161  }
getPersonalWorkspaceDiskQuota()
Gets the minimal personal workspace disk quota imposed by this role.
getDiskQuota()
Gets the minimal disk quota imposed by this role.
read()
loads "role" from database private
+ Here is the call graph for this function:

◆ updateOperationStack()

ilObjRole::updateOperationStack ( $a_stack,
  $a_node,
  $a_init = false 
)
protected

Update operation stack.

Parameters
array$a_stack
int$a_node
Returns

Definition at line 874 of file class.ilObjRole.php.

References ilObject\getId().

Referenced by adjustPermissions().

875  {
876  global $rbacreview;
877 
878  if($a_node == ROOT_FOLDER_ID)
879  {
880  $rolf = ROLE_FOLDER_ID;
881  }
882  else
883  {
884  $rolf = $rbacreview->getRoleFolderIdOfObject($a_node);
885 
886  if($a_init)
887  {
888  $parent_roles = $rbacreview->getParentRoleIds($a_node,false);
889  if($parent_roles[$this->getId()])
890  {
891  $a_stack[] = $rbacreview->getAllOperationsOfRole(
892  $this->getId(),
893  $parent_roles[$this->getId()]['parent']
894  );
895  }
896  return true;
897  }
898  }
899 
900  if(!$rolf)
901  {
902  return false;
903  }
904 
905  $a_stack[] = $rbacreview->getAllOperationsOfRole(
906  $this->getId(),
907  $rolf
908  );
909  return true;
910  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updatePolicyStack()

ilObjRole::updatePolicyStack ( $a_stack,
  $a_node 
)
protected

Update policy stack.

Parameters
object$a_node
Returns

Definition at line 917 of file class.ilObjRole.php.

Referenced by adjustPermissions().

918  {
919  global $rbacreview;
920 
921  if($a_node == ROOT_FOLDER_ID)
922  {
923  $rolf = ROLE_FOLDER_ID;
924  }
925  else
926  {
927  $rolf = $rbacreview->getRoleFolderIdOfObject($a_node);
928  }
929 
930  if(!$rolf)
931  {
932  return false;
933  }
934 
935  $a_stack[] = $rolf;
936  return TRUE;
937  }
+ Here is the caller graph for this function:

◆ validate()

ilObjRole::validate ( )

Validate role data.

Returns
bool

Definition at line 56 of file class.ilObjRole.php.

References $ilErr, and ilObject\getTitle().

57  {
58  global $ilErr;
59 
60  if(substr($this->getTitle(),0,3) == 'il_')
61  {
62  $ilErr->setMessage('msg_role_reserved_prefix');
63  return false;
64  }
65  return true;
66  }
getTitle()
get object title public
+ Here is the call graph for this function:

Field Documentation

◆ $allow_register

ilObjRole::$allow_register

Definition at line 31 of file class.ilObjRole.php.

◆ $assign_users

ilObjRole::$assign_users

Definition at line 32 of file class.ilObjRole.php.

◆ $disk_quota

ilObjRole::$disk_quota

The disk quota in bytes.

Definition at line 35 of file class.ilObjRole.php.

Referenced by getDiskQuota().

◆ $parent

ilObjRole::$parent

Definition at line 29 of file class.ilObjRole.php.

Referenced by getParent().

◆ $wsp_disk_quota

ilObjRole::$wsp_disk_quota

Definition at line 36 of file class.ilObjRole.php.

Referenced by getPersonalWorkspaceDiskQuota().

◆ MODE_PROTECTED_DELETE_LOCAL_POLICIES

◆ MODE_PROTECTED_KEEP_LOCAL_POLICIES

const ilObjRole::MODE_PROTECTED_KEEP_LOCAL_POLICIES = 2

◆ MODE_UNPROTECTED_DELETE_LOCAL_POLICIES

◆ MODE_UNPROTECTED_KEEP_LOCAL_POLICIES

const ilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES = 4

The documentation for this class was generated from the following file: