Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

role (migration step)

Creates, updates, ensures or deletes a role with its policies and limitations, or assigns it to users and user groups or takes it from them.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/migration-steps/role.md

On this page

role

Creates, updates, ensures or deletes a role with its policies and limitations, or assigns it to users and user groups or takes it from them.

A step of a YAML migration with type: role. The class expMigrationStepRole (kernel/classes/migration/steps/expmigrationsteprole.php) is registered in settings/migration.ini [StepSettings] StepTypeList[role].

Modes

mode: is one of create, update, ensure, delete, assign, unassign; every step names one.

Keys

KeyTypeModesDefaultWhat it is
roleidentifier (role)update, delete, assign, unassignthe role: its name or id
namestringcreate, update, ensurethe name of the role; ensure finds the role by it (update: a new name)
policieslistcreate, ensurethe policies, each a map: module, function (* for all) and limitations (identifier => list of values); ensure adds those the role does not have
add_policieslistupdatepolicies to add, as in policies:
remove_policieslistupdatepolicies to remove, each a map: module and function (without function: every policy of the module)
userslistassign, unassignthe users: logins, ids or remote:<remote id>
groupslistassign, unassignthe user groups (or other objects): object identifiers
subtreeidentifier (node)assign, unassignthe assignment is limited to the subtree of this node
sectionidentifier (section)assign, unassignthe assignment is limited to this section
missingstring: fail, skipupdate, delete, assign, unassign"fail"what happens when the role is not there: fail (the default) or skip

Besides these, every step takes the keys of the engine: type, mode, if, references, environments, engines and comment (the file format). A key of type identifier names a node, an object or another part of the installation by id, remote id, path or name (identifiers).

Values for references

references: { <name>: <value> } keeps a value of the step's result as ${ref.<name>} for the steps and migrations after it:

ValueWhat it is
role_idthe id of the role
nameits name
createdtrue when the step created the role
changedtrue when the step changed it (created, updated, deleted, assigned or unassigned)

Undoing

Some steps of this type undo themselves when their migration is rolled back without down: (the class says which); a migration with any other step of it needs down: or a rollback to its caption.

Caches it touches (cleared after the run): user_info_cache, content.

Example

- type: role
  mode: ensure
  name: News editor
  policies:
    - { module: content, function: read }
    - { module: content, function: edit, limitations: { Class: [ news_article ], Subtree: [ "path:news" ] } }
- type: role
  mode: assign
  role: News editor
  groups: [ "remote:news-editors" ]
  subtree: "path:news"

Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationsteprole.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x