ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilUDFPermissionHelper Class Reference

UDF permission helper. More...

+ Inheritance diagram for ilUDFPermissionHelper:
+ Collaboration diagram for ilUDFPermissionHelper:

Data Fields

const CONTEXT_UDF = 1
const CONTEXT_FIELD = 2
const ACTION_UDF_CREATE_FIELD = 1
const ACTION_FIELD_EDIT = 1
const ACTION_FIELD_DELETE = 2
const ACTION_FIELD_EDIT_PROPERTY = 3
const ACTION_FIELD_EDIT_ACCESS = 4
const SUBACTION_FIELD_TITLE = 1
const SUBACTION_FIELD_PROPERTIES = 2
const SUBACTION_FIELD_ACCESS_VISIBLE_PERSONAL = 1
const SUBACTION_FIELD_ACCESS_VISIBLE_REGISTRATION = 2
const SUBACTION_FIELD_ACCESS_VISIBLE_LOCAL = 3
const SUBACTION_FIELD_ACCESS_VISIBLE_COURSES = 4
const SUBACTION_FIELD_ACCESS_VISIBLE_GROUPS = 5
const SUBACTION_FIELD_ACCESS_CHANGEABLE_PERSONAL = 6
const SUBACTION_FIELD_ACCESS_CHANGEABLE_LOCAL = 7
const SUBACTION_FIELD_ACCESS_REQUIRED = 8
const SUBACTION_FIELD_ACCESS_EXPORT = 9
const SUBACTION_FIELD_ACCESS_SEARCHABLE = 10
const SUBACTION_FIELD_ACCESS_CERTIFICATE = 11

Protected Member Functions

 readContextIds ($a_context_type)
 Get all context ids for context type (from DB, is cached)
 buildPermissionMap ()
 Build map of context and actions.
 getActivePlugins ()
 Get active plugins (for current slot)
- Protected Member Functions inherited from ilClaimingPermissionHelper
 __construct ($a_user_id, $a_ref_id)
 Constructor.
 setUserId ($a_value)
 Set user id.
 getUserId ()
 Get user id.
 setRefId ($a_value)
 Set ref id.
 getRefId ()
 Get ref id.
 isValidContextAndAction ($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
 Check if given combination of context and action is valid.
 getValidContextIds ($a_context_type)
 Get context ids for context type (uses cache)
 checkPermission ($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
 Check permission (helper: rbac, plugins)
 checkRBAC ()
 Check permission against RBAC.
 checkPlugins ($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
 Check permission against plugins.

Additional Inherited Members

- Public Member Functions inherited from ilClaimingPermissionHelper
 reset ()
 Reset (internal caches)
 hasPermission ($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
 Check permission.
 hasPermissions ($a_context_type, $a_context_id, array $a_action_ids)
 Check permissions.
- Static Public Member Functions inherited from ilClaimingPermissionHelper
static getInstance ($a_user_id=null, $a_ref_id=null)
 Factory.
- Protected Attributes inherited from ilClaimingPermissionHelper
 $user_id
 $ref_id
 $map
 $context_ids
 $plugins
- Static Protected Attributes inherited from ilClaimingPermissionHelper
static $instances

Detailed Description

UDF permission helper.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilUDFPermissionHelper.php.

Member Function Documentation

ilUDFPermissionHelper::buildPermissionMap ( )
protected

Build map of context and actions.

Returns
array

Reimplemented from ilClaimingPermissionHelper.

Definition at line 75 of file class.ilUDFPermissionHelper.php.

{
return array(
self::CONTEXT_UDF => array(
"actions" => array(
self::ACTION_UDF_CREATE_FIELD
)
),
self::CONTEXT_FIELD => array(
"actions" => array(
self::ACTION_FIELD_EDIT,
self::ACTION_FIELD_DELETE
),
"subactions" => array(
self::ACTION_FIELD_EDIT_PROPERTY =>
array(
self::SUBACTION_FIELD_TITLE
,self::SUBACTION_FIELD_PROPERTIES
)
,self::ACTION_FIELD_EDIT_ACCESS =>
array(
self::SUBACTION_FIELD_ACCESS_VISIBLE_PERSONAL
,self::SUBACTION_FIELD_ACCESS_VISIBLE_REGISTRATION
,self::SUBACTION_FIELD_ACCESS_VISIBLE_LOCAL
,self::SUBACTION_FIELD_ACCESS_VISIBLE_COURSES
,self::SUBACTION_FIELD_ACCESS_VISIBLE_GROUPS
,self::SUBACTION_FIELD_ACCESS_CHANGEABLE_PERSONAL
,self::SUBACTION_FIELD_ACCESS_CHANGEABLE_LOCAL
,self::SUBACTION_FIELD_ACCESS_REQUIRED
,self::SUBACTION_FIELD_ACCESS_EXPORT
,self::SUBACTION_FIELD_ACCESS_SEARCHABLE
,self::SUBACTION_FIELD_ACCESS_CERTIFICATE
)
)
)
);
}
ilUDFPermissionHelper::getActivePlugins ( )
protected

Get active plugins (for current slot)

Returns
array ilPlugin

Reimplemented from ilClaimingPermissionHelper.

Definition at line 116 of file class.ilUDFPermissionHelper.php.

References $res, and IL_COMP_SERVICE.

{
global $ilPluginAdmin;
$res = array();
foreach($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "User", "udfc") as $plugin_name)
{
$res[] = $ilPluginAdmin->getPluginObject(IL_COMP_SERVICE,
"User", "udfc", $plugin_name);
}
return $res;
}
ilUDFPermissionHelper::readContextIds (   $a_context_type)
protected

Get all context ids for context type (from DB, is cached)

See Also
self::getValidContextIds()
Parameters
int$a_context_type
Returns
array

Reimplemented from ilClaimingPermissionHelper.

Definition at line 46 of file class.ilUDFPermissionHelper.php.

References $_REQUEST, $ilDB, $res, and $row.

{
global $ilDB;
switch($a_context_type)
{
case self::CONTEXT_UDF:
return array($_REQUEST["ref_id"]);
case self::CONTEXT_FIELD:
$set = $ilDB->query("SELECT field_id id".
" FROM udf_definition");
break;
default:
return array();
}
$res = array();
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row["id"];
}
return $res;
}

Field Documentation

const ilUDFPermissionHelper::ACTION_FIELD_DELETE = 2

Definition at line 23 of file class.ilUDFPermissionHelper.php.

Referenced by ilCustomUserFieldsGUI\deleteField().

const ilUDFPermissionHelper::ACTION_FIELD_EDIT = 1
const ilUDFPermissionHelper::ACTION_FIELD_EDIT_PROPERTY = 3
const ilUDFPermissionHelper::ACTION_UDF_CREATE_FIELD = 1
const ilUDFPermissionHelper::CONTEXT_UDF = 1
const ilUDFPermissionHelper::SUBACTION_FIELD_PROPERTIES = 2
const ilUDFPermissionHelper::SUBACTION_FIELD_TITLE = 1

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