Enabling and Disabling Tabs on AEM 6.1 Assets Metadata Schemas Using Groups
AEM 6 includes a neat feature that allows metadata form customization with metadata schemas.
Join the DZone community and get the full member experience.
Join For Freewith adobe experience manager 6.x we have a feature that allow to customize the metadata form for assets via metadata schemas. you can find the documentation here .
to change or create a new schema we need to go to:
tools -> assets -> metadata schemas
in this post we will add two new tabs in the schema and set them to be displayed based on the group the user belongs to.
so let’s start.
add the new tabs
we navigate to the metadata schemas section to edit the default schema. we need to select the schema and click in the edit button.
once the schema editor is open, we need to add two new tabs by clicking in the plus button near the last tab:
we will add two new tabs: tab1 and tab2.
after adding the tabs it will look like below:
as we added the two new tabs in the default schema, they will appear if we edit any asset in aem.
create the groups
in this example we will set this to display the tab1 for the users on group1 and tab2 for users on group2.
in order to do this, we need to create these groups.
to do that we need to navigate to:
tools -> operations -> security -> groups
and now click on add group.
we need to create two groups: group1 and group2.
once we create the groups, we need to add them as members of the dam-users group in order to allow the users to edit assets.
to do that, edit the dam-users group and add group1 and group2 as member of the group:
now we need to create the users.
create the users
to create the new users we need to navigate to:
tools -> operations -> security -> users
and click on add user.
we will create two users: usergroup1 and usergroup2. for testing purposes we need to set only the userid and password and add the user to the correct group.
once we have the groups, we need to set the permissions.
set the permissions
to set the permissions for each group we need to go the permissions section:
tools -> operations -> security -> permissions
the default schemas are located at:
/libs/dam/content/schemaeditors/forms/
but once we changed it, the updated one is saved in the apps folders:
/apps/dam/content/schemaeditors/forms/
in the permissions section we are going to grant the permissions for each group for the tabs we created, let’s start with group 1:
as we can see, we needed to navigate in the node structure until reach the tabs. we can see that we have 4 tabs. the tabs3 and tabs4 are the new ones we added in the previous steps.
in the image we can see that we mark the read check box for tab3 and unchecked for tab4.
with this config we are saying that the users of this group have read permission for the tab3 but not for the tab 4.
we will do a similar thing for group2, but we will allow read for tab4 and do not allow for tab3, like below:
now let’s test our configuration.
testing
to test our configuration we can log with each user or we can impersonate the users if we are logged as admin.
logged as admin we can see both tabs:
logged as usergroup1 we can see only the tab1:
logged as usergroup2 we can see only the tab2:
that’s it! i hope you enjoyed it.
see you in the next post.
Published at DZone with permission of Francisco Ribeiro, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments