问题
I am looking for a possibility to choose certain roles in a Page property Dialog. Some parts of the page should be only viewable to certain roles.
What I got is
- name: allowedRoles
class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
label: Select Roles
field:
name: roleLinkField
class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
targetWorkspace: userroles
appName: security
identifierToPathConverter:
class: info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter
This lets me only choose user not userroles.. What do I need to do to choose from the subapp of "security" called "roles"?
回答1:
Ok, this took a while to figure out, but turns out relatively simple in the end:
- define
chooseDialog
in the app from which you want to choose from different subapp explicitly (in your case insecurity-app
) - in the
chooseDialog
, define workbench field pointing to workbench in subapp of interest (roles in your case). Class definition for the field must be specified here explicitly. - also in
chooseDialog
, definecontentConnector
pointing to connector of interest (in roles subapp in your case) - in the dialog where you are adding the link field, in the definition of the link field, set
appName
to the app (security
in your case) and settargetWorkspace
to the workspace of the connector you linked fromchooseDialog
in the step above (userroles
in your case).
All should work then. Limitation is that you can have only one such choose dialog definition per app so you have to choose from which subapp you want to link items from.
Example of configuration for what you want: https://gist.github.com/rah003/29910e92067effaebed9156d6bdc293a
HTH,
Jan
来源:https://stackoverflow.com/questions/46035079/magnolia-cms-5-5-5-choose-from-roles