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

p3d3r0s0
Champ in-the-making
Champ in-the-making
By changing the titlebar.jsp i was able to give access to the administration console, but i cant add users or do any of the other operations because i dont have permission. Where is the permission verification made?

ebogaard
Champ on-the-rise
Champ on-the-rise
This is about the same I'm looking for. (http://forums.alfresco.com/en/viewtopic.php?f=9&t=26656)
Couldn't find anything in manuals or forums. Haven't got an answer on my post either.

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
You can do this by editing :
web.xml
    Admin Authentication Filter ( you can remove the usage of admin filter , this would be wrong idea, but you can do this)

class Smiley Surprisedrg.alfresco.web.app.servlet.AdminAuthenticationFilter , this class checks if current user is admin or not .

you can create some cind of group for "admin" users and checking this in the class adminAuthfilter if they are in this group then give them access.

p3d3r0s0
Champ in-the-making
Champ in-the-making
you can create some cind of group for "admin" users and checking this in the class adminAuthfilter if they are in this group then give them access.

that seems ideal, but i still needed to remove the access to the dictionary space and i think that if i make a user an admin, i cant stop him from accessing a space.

i tried removing these fields:
You can do this by editing :
web.xml
    Admin Authentication Filter ( you can remove the usage of admin filter , this would be wrong idea, but you can do this)

class Smiley Surprisedrg.alfresco.web.app.servlet.AdminAuthenticationFilter , this class checks if current user is admin or not .

but i still couldnt create a user using with a user that wasnt an admin.

Am i missing something?

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
Well , you need to do some coding for this.
for instance:
you have to code in that class ( you would replace that class with your own and inherit it ) next:
if current user in in group : LIKE_ADMIN_GROUP filter it.

and you create in alfresco group LIKE_ADMIN_GROUP and this should do it.**


** this filter like authentification filter filters who has access to what .

if (isAdmin)
      {
//add hire :
//get all users from that group
authorities = this.getAuthorityService()
         .getContainedAuthorities(AuthorityType.USER,
            "GROUP_NAME_GROUP", immediate);
//get current user
String currentUserName=Application.getCurrentUser(FacesContext.getCurrentInstance()).getUserName();

//check if current user is in this group
for (String authority : authorities) {
NodeRef ref = this.getPersonService().getPerson(authority);

String userName= this.getNodeService().getProperty(ref, ContentModel.PROP_USERNAME);

if(userName.equals(currentUserName))//current user is in this group
{
  chain.doFilter(req, res);
}

}


this sould do it, you would have acces to admin parts,
also you can create multiple filters, and define some kind of security for your self.

So have funn coding this out, but I think this is more or less what you need to make it nice and net .

PS: change classs of filter admin authentification filter according to what you jave coded out.








         chain.doFilter(req, res); //if is admin go to the page like /jsp/admin/….
      }
      else
      {
            httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN); //return 403
         }
       
      }

ebogaard
Champ on-the-rise
Champ on-the-rise
It looks like this is what I was looking for, but the problem is that the post isn't complete / is malformed.
And I'm afraid I would like some more detailed instructions on how to do this.

Savic, could you edit your post to make it complete and maybe give some more hints?
Thanks!

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
I have thought that you are programmer.
I will send you code soon( monday or tuesday)  and I guess you will have solved problem. If this time frame is ok, if not you could $$ to someone to get you the code faster.

send me the version of your alfresco.

p3d3r0s0
Champ in-the-making
Champ in-the-making
Just checking, is this coding process made on eclipse? will i have to make a java class for this purpose or can this be done in a jsp or xml file?

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
This is done in eclipse.