Do role assignemnts
More...
Do role assignemnts
- Author
- Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
- Version
- $Id$
Definition at line 32 of file class.ilLDAPRoleAssignmentRules.php.
◆ callPlugin()
static ilLDAPRoleAssignmentRules::callPlugin |
( |
|
$a_plugin_id, |
|
|
|
$a_user_data |
|
) |
| |
|
static |
Call plugin check if the condition matches.
- Returns
- bool
- Parameters
-
object | $a_plugin_id | |
object | $a_user_data | |
Definition at line 233 of file class.ilLDAPRoleAssignmentRules.php.
References $ok, and IL_COMP_SERVICE.
Referenced by ilLDAPRoleAssignmentRule\matches().
235 global $ilPluginAdmin;
237 if(self::$active_plugins == null)
239 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
245 foreach(self::$active_plugins as $plugin_name)
255 $ok = $plugin_obj->checkRoleAssignment($a_plugin_id,$a_user_data);
Interface for ldap role assignment plugins.
◆ getAdditionalPluginAttributes()
static ilLDAPRoleAssignmentRules::getAdditionalPluginAttributes |
( |
|
$a_server_id | ) |
|
|
staticprotected |
Fetch additional attributes from plugin.
- Parameters
-
- Returns
Definition at line 273 of file class.ilLDAPRoleAssignmentRules.php.
References $ok, and IL_COMP_SERVICE.
275 global $ilPluginAdmin;
277 if(self::$active_plugins == null)
279 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
284 $attributes = array();
285 foreach(self::$active_plugins as $plugin_name)
295 $attributes = array_merge($attributes,$plugin_obj->getAdditionalAttributeNames());
298 return $attributes ? $attributes : array();
Interface for ldap role assignment plugins.
◆ getAllPossibleRoles()
static ilLDAPRoleAssignmentRules::getAllPossibleRoles |
( |
|
$a_server_id | ) |
|
|
static |
◆ getAssignmentsForCreation()
static ilLDAPRoleAssignmentRules::getAssignmentsForCreation |
( |
|
$a_server_id, |
|
|
|
$a_usr_name, |
|
|
|
$a_usr_data |
|
) |
| |
|
static |
- Returns
- array role data
- Parameters
-
int | $a_server_id | |
object | $a_usr_id | |
object | $a_usr_data | public |
Definition at line 181 of file class.ilLDAPRoleAssignmentRules.php.
References $ilDB, $ilLog, $query, $res, $row, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ilObject\_lookupTitle(), and DB_FETCHMODE_OBJECT.
Referenced by ilAuthContainerApache\forceCreation(), ilLDAPUserSynchronisation\handleAccountMigration(), and ilLDAPAttributeToUser\usersToXML().
185 $query =
"SELECT rule_id FROM ldap_role_assignments ".
186 'WHERE server_id = '.$ilDB->quote($a_server_id,
'integer');
193 include_once
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
196 if($rule->matches($a_usr_data))
199 $ilLog->write(__METHOD__.
': Assigned to role: '.$a_usr_name.
' => '.
ilObject::_lookupTitle($rule->getRoleId()));
200 $roles[] = self::parseRole($rule->getRoleId(),self::ROLE_ACTION_ASSIGN);
205 $found_global =
false;
206 foreach($roles as $role_data)
208 if($role_data[
'type'] ==
'Global')
210 $found_global =
true;
216 $ilLog->write(__METHOD__.
': No matching rule found. Assigning to default role.');
217 $roles[] = self::parseRole(
218 self::getDefaultRole($a_server_id),
219 self::ROLE_ACTION_ASSIGN
223 return $roles ? $roles : array();
static _lookupTitle($a_id)
lookup object title
const DB_FETCHMODE_OBJECT
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
◆ getAssignmentsForUpdate()
static ilLDAPRoleAssignmentRules::getAssignmentsForUpdate |
( |
|
$a_server_id, |
|
|
|
$a_usr_id, |
|
|
|
$a_usr_name, |
|
|
|
$a_usr_data |
|
) |
| |
|
static |
type $ilDB type $rbacadmin type $rbacreview type $ilSetting type $ilLog
- Parameters
-
int | $a_server_id | |
type | $a_usr_id | |
type | $a_usr_name | |
type | $a_usr_data | |
- Returns
- array
Definition at line 118 of file class.ilLDAPRoleAssignmentRules.php.
References $ilDB, $ilLog, $ilSetting, $query, $res, $row, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ilObject\_lookupTitle(), and DB_FETCHMODE_OBJECT.
Referenced by ilLDAPAttributeToUser\usersToXML().
122 $query =
"SELECT rule_id,add_on_update,remove_on_update FROM ldap_role_assignments ".
123 "WHERE (add_on_update = 1 OR remove_on_update = 1) ".
124 'AND server_id = '.$ilDB->quote($a_server_id,
'integer');
130 include_once
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
133 $matches = $rule->matches($a_usr_data);
134 if($matches and
$row->add_on_update)
136 $ilLog->write(__METHOD__.
': Assigned to role: '.$a_usr_name.
' => '.
ilObject::_lookupTitle($rule->getRoleId()));
137 $roles[] = self::parseRole($rule->getRoleId(), self::ROLE_ACTION_ASSIGN);
140 if(!$matches and
$row->remove_on_update)
142 $ilLog->write(__METHOD__.
': Deassigned from role: '.$a_usr_name.
' => '.
ilObject::_lookupTitle($rule->getRoleId()));
143 $roles[] = self::parseRole($rule->getRoleId(), self::ROLE_ACTION_DEASSIGN);
148 $deassigned_global = 0;
149 foreach($roles as $role_data)
151 if($role_data[
'type'] ==
'Global' and
152 $role_data[
'action'] == self::ROLE_ACTION_DEASSIGN)
154 $deassigned_global++;
157 if(count($rbacreview->assignedGlobalRoles($a_usr_id)) == $deassigned_global)
159 $ilLog->write(__METHOD__.
': No global role left. Assigning to default role.');
160 $roles[] = self::parseRole(
161 self::getDefaultRole($a_server_id),
162 self::ROLE_ACTION_ASSIGN
166 return $roles ? $roles : array();
static _lookupTitle($a_id)
lookup object title
const DB_FETCHMODE_OBJECT
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
◆ getAttributeNames()
static ilLDAPRoleAssignmentRules::getAttributeNames |
( |
|
$a_server_id | ) |
|
|
static |
◆ getDefaultRole()
static ilLDAPRoleAssignmentRules::getDefaultRole |
( |
|
$a_server_id | ) |
|
|
static |
Get default global role.
- Parameters
-
- Returns
Definition at line 46 of file class.ilLDAPRoleAssignmentRules.php.
References ilLDAPAttributeMapping\_lookupGlobalRole().
49 include_once
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
50 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
52 return self::$default_role =
static _lookupGlobalRole($a_server_id)
Lookup global role assignment.
◆ parseRole()
static ilLDAPRoleAssignmentRules::parseRole |
( |
|
$a_role_id, |
|
|
|
$a_action |
|
) |
| |
|
staticprotected |
Parse role.
- Returns
- Parameters
-
int | $a_role_id | |
string | $a_action | |
Definition at line 308 of file class.ilLDAPRoleAssignmentRules.php.
314 'type' => $rbacreview->isGlobalRole($a_role_id) ?
'Global' :
'Local',
315 'action' => $a_action
◆ $active_plugins
ilLDAPRoleAssignmentRules::$active_plugins = null |
|
staticprotected |
◆ $default_role
ilLDAPRoleAssignmentRules::$default_role = null |
|
staticprotected |
◆ ROLE_ACTION_ASSIGN
const ilLDAPRoleAssignmentRules::ROLE_ACTION_ASSIGN = 'Assign' |
◆ ROLE_ACTION_DEASSIGN
const ilLDAPRoleAssignmentRules::ROLE_ACTION_DEASSIGN = 'Detach' |
The documentation for this class was generated from the following file: