Expand my Community achievements bar.

SOLVED

System User Session Permissions AEM 6.3

Avatar

Level 4

Hi Team,

We are using admin login session on AEM6.0  "session = repository.loginAdministrative(getDefaultWorkspaceName())"  . Now we are migrating to AEM6.3 using new approach of getting session i.e created a system user and added the same user in the user mapper service config.

Question:

1.  How to make system user works as admin session means to have same permissions "repository.loginAdministrative(getDefaultWorkspaceName()) "  method. ?

Thanks

Sumit

1 Accepted Solution

Avatar

Correct answer by
Level 10

1. Use the above approach

2. Assign administrator group to a system user, but that's not the recommended approach. Should always assign only required permission.

Thanks

View solution in original post

4 Replies

Avatar

Level 10

Above API methods are deprecated, you should not be using it.

@Reference

private ResourceResolverFactory resourceFactory;

Map<String,Object> paramMap = new HashMap<String,Object>();

//Mention the subServiceName you had used in the User Mapping

paramMap.put(ResourceResolverFactory.SUBSERVICE, "readService");

ResourceResolver resoved = resourceFactory.getServiceResourceResolver(paramMap);

Avatar

Level 4

Hi,

Thank you !!

I know this approach but my query is how can I achieve admin session using system users.

Thanks

Sumit

Avatar

Correct answer by
Level 10

1. Use the above approach

2. Assign administrator group to a system user, but that's not the recommended approach. Should always assign only required permission.

Thanks