cancel
Showing results for 
Search instead for 
Did you mean: 

Giving a user access to administration console

p3d3r0s0
Champ in-the-making
Champ in-the-making
Is this possible? Without giving the user the admin role? I want to give a user access to the administration console and be able to do all options there but not be able to access the dictionary path. Is this possible?

Best reguards,
Pedro
21 REPLIES 21

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
You could override NavigationBean and add method where you would check if user is member of some group.

p3d3r0s0
Champ in-the-making
Champ in-the-making
Yes, thats what i want to do. I just dont know what method does that. Ithough i could use AuthorityServiceImpl and the getContainedAuthorities method, but i get an error. Is there any other method that i can use in the jsp to tell me what groups the user belongs to?
Im getting the currentUserName from the TenantAdminConsoleBean. How can i get the user's groups?

I was trying this:
<%@ page import="org.alfresco.web.bean.repository.tenant.TenantAdminConsoleBean" %><%@ page import="org.alfresco.web.bean.NavigationBean" %><%@ page import="org.alfresco.repo.security.authority.AuthorityServiceImpl" %><%@ page import="org.alfresco.service.cmr.security.AuthorityType" %><%@ page import="java.util.Set" %><% TenantAdminConsoleBean tac = new TenantAdminConsoleBean();String myUserName= tac.getCurrentUserName();AuthorityServiceImpl asi = new AuthorityServiceImpl();Set<String> myGroups = asi.getContainingAuthorities(AuthorityType.GROUP, myUserName, false);boolean isContained = myGroups.contains("myAdmins");//person.getPerson(teste3); %>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

but i get an error on:
Set<String> myGroups = asi.getContainingAuthorities(AuthorityType.GROUP, myUserName, false);
the error is:
Stacktrace:
caused by:
and
Stacktrace:
caused by:
java.lang.NullPointerException

what is wrong with my code?