|
static static | addNewType ($a_type_id, $a_type_title) |
| Add new type to object data. More...
|
|
static | addRBACOperations ($a_type_id, array $a_operations) |
| Add RBAC operations for type. More...
|
|
static | addRBACOperation ($a_type_id, $a_ops_id) |
| Add RBAC operation. More...
|
|
static | isRBACOperation ($a_type_id, $a_ops_id) |
| Check if rbac operation exists. More...
|
|
static | deleteRBACOperation ($a_type, $a_ops_id) |
| Delete rbac operation. More...
|
|
static | deleteRBACTemplateOperation ($a_type, $a_ops_id) |
| Delete operation for type in templates. More...
|
|
static | getCustomRBACOperationId ($a_operation) |
| Get id of RBAC operation. More...
|
|
static | addCustomRBACOperation ($a_id, $a_title, $a_class, $a_pos) |
| Add custom RBAC operation. More...
|
|
static | getObjectTypeId ($a_type) |
| Get id for object data type entry. More...
|
|
static | addRBACCreate ($a_id, $a_title, array $a_parent_types) |
| Add create RBAC operations for parent object types. More...
|
|
static | updateOperationOrder ($a_operation, $a_pos) |
| Change order of operations. More...
|
|
static | addAdminNode ($a_obj_type, $a_title) |
| Create new admin object node. More...
|
|
static | cloneOperation ($a_obj_type, $a_source_op_id, $a_target_op_id) |
| Clone RBAC-settings between operations. More...
|
|
static | varchar2text ($a_table_name, $a_column_name) |
| Migrate varchar column to text/clob. More...
|
|
static | addRBACTemplate ($a_obj_type, $a_id, $a_description, $a_op_ids) |
| Add new RBAC template. More...
|
|
static | setRolePermission ($a_rol_id, $a_type, $a_ops, $a_ref_id) |
|
static | applyInitialPermissionGuideline ($objectType, $hasLearningProgress=false, $usedForAuthoring=false) |
| This method will apply the 'Initial Permissions Guideline' when introducing new object types. More...
|
|
Helper class to create new object types (object_data, RBAC)
- Author
- Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
- Id
- class.ilObjFolderGUI.php 25134 2010-08-13 14:22:11Z smeyer
Definition at line 13 of file class.ilDBUpdateNewObjectType.php.
static ilDBUpdateNewObjectType::applyInitialPermissionGuideline |
( |
|
$objectType, |
|
|
|
$hasLearningProgress = false , |
|
|
|
$usedForAuthoring = false |
|
) |
| |
|
static |
This method will apply the 'Initial Permissions Guideline' when introducing new object types.
This method does not apply permissions to existing obejcts in the ILIAS repository ('change existing objects').
- Parameters
-
string | $objectType | |
bool | $hasLearningProgress | A boolean flag whether or not the object type supports learning progress |
bool | $usedForAuthoring | A boolean flag to tell whether or not the object type is mainly used for authoring |
- See also
- https://www.ilias.de/docu/goto_docu_wiki_wpage_2273_1357.html
Definition at line 632 of file class.ilDBUpdateNewObjectType.php.
References $DIC, $ilDB, $query, $res, $row, array, and getCustomRBACOperationId().
635 $ilDB = $DIC[
'ilDB'];
636 $objectTypeId = self::getObjectTypeId($objectType);
637 if (!$objectTypeId) {
638 die(
"Something went wrong, there MUST be valid id for object_type " . $objectType);
641 if (!$objectCreateOperationId) {
642 die(
"Something went wrong, missing CREATE operation id for object type " . $objectType);
644 $globalRoleFolderId = 8;
645 $learningProgressPermissions = [];
646 if ($hasLearningProgress) {
647 $learningProgressPermissions = array_filter([
648 self::getCustomRBACOperationId(
'read_learning_progress'),
649 self::getCustomRBACOperationId(
'edit_learning_progress'),
652 foreach (self::$initialPermissionDefinition as $roleType => $roles) {
653 foreach ($roles as $roleTitle => $definition) {
655 true === $usedForAuthoring &&
656 array_key_exists(
'ignore_for_authoring_objects', $definition) &&
657 true === $definition[
'ignore_for_authoring_objects']
661 if (array_key_exists(
'id', $definition) && is_numeric($definition[
'id'])) {
663 $query =
"SELECT obj_id FROM object_data WHERE type = %s AND obj_id = %s";
664 $queryTypes = [
'text',
'integer'];
665 $queryValues = [$roleType, $definition[
'id']];
667 $query =
"SELECT obj_id FROM object_data WHERE type = %s AND title = %s";
668 $queryTypes = [
'text',
'text'];
669 $queryValues = [$roleType, $roleTitle];
674 $roleId = (int)
$row[
'obj_id'];
676 if (array_key_exists(
'object', $definition) && is_array($definition[
'object'])) {
677 $operationIds = array_merge($operationIds, (
array) $definition[
'object']);
679 if (array_key_exists(
'lp', $definition) &&
true === $definition[
'lp']) {
680 $operationIds = array_merge($operationIds, $learningProgressPermissions);
682 self::setRolePermission(
685 array_filter(array_map(
'intval', $operationIds)),
688 if (array_key_exists(
'create', $definition) && is_array($definition[
'create'])) {
689 foreach ($definition[
'create'] as $containerObjectType) {
690 self::setRolePermission(
692 $containerObjectType,
694 $objectCreateOperationId
static getCustomRBACOperationId($a_operation)
Get id of RBAC operation.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.