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

Advanced metadata permission helper. More...

+ Inheritance diagram for ilAdvancedMDPermissionHelper:
+ Collaboration diagram for ilAdvancedMDPermissionHelper:

Data Fields

const CONTEXT_MD = 1
const CONTEXT_RECORD = 2
const CONTEXT_FIELD = 3
const CONTEXT_SUBSTITUTION = 4
const CONTEXT_SUBSTITUTION_COURSE = 5
const CONTEXT_SUBSTITUTION_CATEGORY = 6
const ACTION_MD_CREATE_RECORD = 1
const ACTION_MD_IMPORT_RECORDS = 2
const ACTION_RECORD_EDIT = 5
const ACTION_RECORD_DELETE = 6
const ACTION_RECORD_EXPORT = 7
const ACTION_RECORD_TOGGLE_ACTIVATION = 8
const ACTION_RECORD_EDIT_PROPERTY = 9
const ACTION_RECORD_EDIT_FIELDS = 10
const ACTION_RECORD_CREATE_FIELD = 11
const ACTION_RECORD_FIELD_POSITIONS = 12
const ACTION_FIELD_EDIT = 13
const ACTION_FIELD_DELETE = 14
const ACTION_FIELD_EDIT_PROPERTY = 15
const ACTION_SUBSTITUTION_SHOW_DESCRIPTION = 16
const ACTION_SUBSTITUTION_SHOW_FIELDNAMES = 17
const ACTION_SUBSTITUTION_FIELD_POSITIONS = 18
const ACTION_SUBSTITUTION_COURSE_SHOW_FIELD = 19
const ACTION_SUBSTITUTION_COURSE_EDIT_FIELD_PROPERTY = 20
const ACTION_SUBSTITUTION_CATEGORY_SHOW_FIELD = 21
const ACTION_SUBSTITUTION_CATEGORY_EDIT_FIELD_PROPERTY = 22
const SUBACTION_RECORD_TITLE = 1
const SUBACTION_RECORD_DESCRIPTION = 2
const SUBACTION_RECORD_OBJECT_TYPES = 3
const SUBACTION_FIELD_TITLE = 4
const SUBACTION_FIELD_DESCRIPTION = 5
const SUBACTION_FIELD_SEARCHABLE = 6
const SUBACTION_FIELD_PROPERTIES = 7
const SUBACTION_SUBSTITUTION_BOLD = 8
const SUBACTION_SUBSTITUTION_NEWLINE = 9

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

Advanced metadata 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.ilAdvancedMDPermissionHelper.php.

Member Function Documentation

ilAdvancedMDPermissionHelper::buildPermissionMap ( )
protected

Build map of context and actions.

Returns
array

Reimplemented from ilClaimingPermissionHelper.

Definition at line 106 of file class.ilAdvancedMDPermissionHelper.php.

{
return array(
self::CONTEXT_MD => array(
"actions" => array(
self::ACTION_MD_CREATE_RECORD
,self::ACTION_MD_IMPORT_RECORDS
)
),
self::CONTEXT_RECORD => array(
"actions" => array(
self::ACTION_RECORD_EDIT
,self::ACTION_RECORD_DELETE
,self::ACTION_RECORD_EXPORT
,self::ACTION_RECORD_TOGGLE_ACTIVATION
,self::ACTION_RECORD_EDIT_FIELDS
,self::ACTION_RECORD_FIELD_POSITIONS
,self::ACTION_RECORD_CREATE_FIELD
),
"subactions" => array(
self::ACTION_RECORD_EDIT_PROPERTY =>
array(
self::SUBACTION_RECORD_TITLE
,self::SUBACTION_RECORD_DESCRIPTION
,self::SUBACTION_RECORD_OBJECT_TYPES
)
)
),
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_DESCRIPTION
,self::SUBACTION_FIELD_SEARCHABLE
,self::SUBACTION_FIELD_PROPERTIES
)
)
),
self::CONTEXT_SUBSTITUTION => array(
"actions" => array(
self::ACTION_SUBSTITUTION_SHOW_DESCRIPTION
,self::ACTION_SUBSTITUTION_SHOW_FIELDNAMES
,self::ACTION_SUBSTITUTION_FIELD_POSITIONS
)
),
self::CONTEXT_SUBSTITUTION_COURSE => array(
"actions" => array(
self::ACTION_SUBSTITUTION_COURSE_SHOW_FIELD
),
"subactions" => array(
self::ACTION_SUBSTITUTION_COURSE_EDIT_FIELD_PROPERTY =>
array(
self::SUBACTION_SUBSTITUTION_BOLD
,self::SUBACTION_SUBSTITUTION_NEWLINE
)
)
),
self::CONTEXT_SUBSTITUTION_CATEGORY => array(
"actions" => array(
self::ACTION_SUBSTITUTION_CATEGORY_SHOW_FIELD
),
"subactions" => array(
self::ACTION_SUBSTITUTION_CATEGORY_EDIT_FIELD_PROPERTY =>
array(
self::SUBACTION_SUBSTITUTION_BOLD
,self::SUBACTION_SUBSTITUTION_NEWLINE
)
)
)
);
}
ilAdvancedMDPermissionHelper::getActivePlugins ( )
protected

Get active plugins (for current slot)

Returns
array ilPlugin

Reimplemented from ilClaimingPermissionHelper.

Definition at line 186 of file class.ilAdvancedMDPermissionHelper.php.

References $res, and IL_COMP_SERVICE.

{
global $ilPluginAdmin;
$res = array();
foreach($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "AdvancedMetaData", "amdc") as $plugin_name)
{
$res[] = $ilPluginAdmin->getPluginObject(IL_COMP_SERVICE,
"AdvancedMetaData", "amdc", $plugin_name);
}
return $res;
}
ilAdvancedMDPermissionHelper::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 67 of file class.ilAdvancedMDPermissionHelper.php.

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

{
global $ilDB;
switch($a_context_type)
{
case self::CONTEXT_MD:
return array($_REQUEST["ref_id"]);
case self::CONTEXT_RECORD:
$set = $ilDB->query("SELECT record_id id".
" FROM adv_md_record");
break;
case self::CONTEXT_FIELD:
case self::CONTEXT_SUBSTITUTION_COURSE:
case self::CONTEXT_SUBSTITUTION_CATEGORY:
$set = $ilDB->query("SELECT field_id id".
" FROM adv_mdf_definition");
break;
case self::CONTEXT_SUBSTITUTION:
return array("crs", "cat");
default:
return array();
}
$res = array();
while($row = $ilDB->fetchAssoc($set))
{
$res[] = $row["id"];
}
return $res;
}

Field Documentation

const ilAdvancedMDPermissionHelper::ACTION_FIELD_DELETE = 14
const ilAdvancedMDPermissionHelper::ACTION_FIELD_EDIT = 13
const ilAdvancedMDPermissionHelper::ACTION_MD_CREATE_RECORD = 1
const ilAdvancedMDPermissionHelper::ACTION_MD_IMPORT_RECORDS = 2
const ilAdvancedMDPermissionHelper::ACTION_RECORD_CREATE_FIELD = 11
const ilAdvancedMDPermissionHelper::ACTION_RECORD_DELETE = 6
const ilAdvancedMDPermissionHelper::ACTION_RECORD_EDIT = 5
const ilAdvancedMDPermissionHelper::ACTION_RECORD_EDIT_FIELDS = 10
const ilAdvancedMDPermissionHelper::ACTION_RECORD_EXPORT = 7
const ilAdvancedMDPermissionHelper::ACTION_RECORD_FIELD_POSITIONS = 12
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_CATEGORY_EDIT_FIELD_PROPERTY = 22
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_CATEGORY_SHOW_FIELD = 21
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_COURSE_EDIT_FIELD_PROPERTY = 20
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_COURSE_SHOW_FIELD = 19
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS = 18
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION = 16
const ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES = 17
const ilAdvancedMDPermissionHelper::CONTEXT_MD = 1
const ilAdvancedMDPermissionHelper::CONTEXT_SUBSTITUTION = 4
const ilAdvancedMDPermissionHelper::CONTEXT_SUBSTITUTION_CATEGORY = 6
const ilAdvancedMDPermissionHelper::CONTEXT_SUBSTITUTION_COURSE = 5
const ilAdvancedMDPermissionHelper::SUBACTION_FIELD_DESCRIPTION = 5
const ilAdvancedMDPermissionHelper::SUBACTION_FIELD_PROPERTIES = 7
const ilAdvancedMDPermissionHelper::SUBACTION_FIELD_TITLE = 4
const ilAdvancedMDPermissionHelper::SUBACTION_RECORD_DESCRIPTION = 2
const ilAdvancedMDPermissionHelper::SUBACTION_RECORD_TITLE = 1
const ilAdvancedMDPermissionHelper::SUBACTION_SUBSTITUTION_BOLD = 8
const ilAdvancedMDPermissionHelper::SUBACTION_SUBSTITUTION_NEWLINE = 9

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