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 229 of file class.ilLDAPRoleAssignmentRules.php.
References $DIC, $ok, and IL_COMP_SERVICE.
Referenced by ilLDAPRoleAssignmentRule\matches().
233 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
235 if (self::$active_plugins == null) {
236 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
244 foreach (self::$active_plugins as $plugin_name) {
246 $plugin_obj = $ilPluginAdmin->getPluginObject(
254 $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 271 of file class.ilLDAPRoleAssignmentRules.php.
References $attributes, $DIC, $ok, and IL_COMP_SERVICE.
275 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
277 if (self::$active_plugins == null) {
278 self::$active_plugins = $ilPluginAdmin->getActivePluginsForSlot(
286 foreach (self::$active_plugins as $plugin_name) {
288 $plugin_obj = $ilPluginAdmin->getPluginObject(
Interface for ldap role assignment plugins.
if(array_key_exists('yes', $_REQUEST)) $attributes
◆ 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 179 of file class.ilLDAPRoleAssignmentRules.php.
References $DIC, $ilDB, $ilLog, $query, $res, $row, $rule, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ilObject\_lookupTitle(), and ilDBConstants\FETCHMODE_OBJECT.
Referenced by ilLDAPAttributeToUser\parseRoleAssignmentsForCreation().
183 $ilDB = $DIC[
'ilDB'];
186 $query =
"SELECT rule_id FROM ldap_role_assignments " .
187 '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 $roles[] = self::parseRole(
$rule->getRoleId(), self::ROLE_ACTION_ASSIGN);
204 $found_global =
false;
205 foreach ($roles as $role_data) {
206 if ($role_data[
'type'] ==
'Global') {
207 $found_global =
true;
211 if (!$found_global) {
212 $ilLog->info(
': No matching rule found. Assigning to default role.');
213 $roles[] = self::parseRole(
214 self::getDefaultRole($a_server_id),
215 self::ROLE_ACTION_ASSIGN
219 return $roles ? $roles : array();
static _lookupTitle($a_id)
lookup object title
foreach($_POST as $key=> $value) $res
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 $DIC, $ilDB, $ilLog, $ilSetting, $query, $res, $row, $rule, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ilObject\_lookupTitle(), and ilDBConstants\FETCHMODE_OBJECT.
Referenced by ilLDAPAttributeToUser\parseRoleAssignmentsForUpdate().
122 $ilDB = $DIC[
'ilDB'];
123 $rbacadmin = $DIC[
'rbacadmin'];
124 $rbacreview = $DIC[
'rbacreview'];
128 $query =
"SELECT rule_id,add_on_update,remove_on_update FROM ldap_role_assignments " .
129 "WHERE (add_on_update = 1 OR remove_on_update = 1) " .
130 'AND server_id = ' .
$ilDB->quote($a_server_id,
'integer');
135 include_once
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
138 $matches =
$rule->matches($a_usr_data);
139 if ($matches
and $row->add_on_update) {
141 $roles[] = self::parseRole(
$rule->getRoleId(), self::ROLE_ACTION_ASSIGN);
143 if (!$matches and
$row->remove_on_update) {
145 $roles[] = self::parseRole(
$rule->getRoleId(), self::ROLE_ACTION_DEASSIGN);
150 $deassigned_global = 0;
151 foreach ($roles as $role_data) {
152 if ($role_data[
'type'] ==
'Global' and
153 $role_data[
'action'] == self::ROLE_ACTION_DEASSIGN) {
154 $deassigned_global++;
157 if (count($rbacreview->assignedGlobalRoles($a_usr_id)) == $deassigned_global) {
158 $ilLog->info(
': No global role left. Assigning to default role.');
159 $roles[] = self::parseRole(
160 self::getDefaultRole($a_server_id),
161 self::ROLE_ACTION_ASSIGN
165 return $roles ? $roles : array();
static _lookupTitle($a_id)
lookup object title
foreach($_POST as $key=> $value) $res
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().
48 include_once
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
49 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
51 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 309 of file class.ilLDAPRoleAssignmentRules.php.
References $DIC.
313 $rbacreview = $DIC[
'rbacreview'];
317 'type' => $rbacreview->isGlobalRole($a_role_id) ?
'Global' :
'Local',
318 '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: