cancel
Showing results for 
Search instead for 
Did you mean: 

Take ownership against Roles

guhann
Champ in-the-making
Champ in-the-making
Eventhough i create a user as consumer and assign him a workspace, he will be getting the option AddContent in his home space.

then what is the purpose of using role??

Ok, to restrict that, as admin i took the ownership for that space, then AddConent is getting disabled. I'ts frustating to do the same thing for each and every user………..

How to disable AddContent for consumer role? or is that possible by default to set the ownership as admin(i dont want the users to create documents, they have only permissions to view).
6 REPLIES 6

kevinr
Star Contributor
Star Contributor
The issue is that the user is given full permissions on the Home Space created for them. They may be Consumer elsewhere, but they still own the home space. Currently this is done in code, so you would need to change the class NewUserWizard (line 960) using the SDK…

Thanks,

Kevin

guhann
Champ in-the-making
Champ in-the-making
NewUserWizard is available in alfresco-community-tomcat-2.1.0R1 version. If i comment that statement then "ALL" permission is getting removed in roles, which is also good so that i can assign the default role as consumer thru (authentication-services-context.xml), but still Add content link is there.

what file i need to modify for alfresco-community-jboss-1.4.0 V.?

Another bug is that Everyone link is getting created automatcially whenever new user is created. how to disable/restrict that?

guhann
Champ in-the-making
Champ in-the-making
Commented another two statements also in that NewWizard class , now Create/Add content link is getting disabled according to the roles.(it will appear only for collaborator,contributor roles)

commented the corresponding  statements …..

1)give full permissions to the new user - to remove "ALL" in roles
2)the new user is the OWNER of their own space and always has full permissions - to disable the create/Add content

only issue is that which file i need to modify for jboss 1.4.0 V.??

Cheers

guhann
Champ in-the-making
Champ in-the-making
sorry the same file is also available in jboss version. it's in web-client.jar file. Is there any way to get the source of jboss 1.4.0?

guhann
Champ in-the-making
Champ in-the-making
I have commented as given below. The problem is for editor role i cannot able to checkout/edit the file. Basically what i need is if the role is conumer i don't want the AddContent to be displayed.Also if possible i need to remove the "All" permission by default.

private void setupHomeSpacePermissions(NodeRef homeSpaceRef)
    {
       // permissionService.setPermission(homeSpaceRef, userName, permissionService.getAllPermission(), true);
        String permission = getDefaultPermission();
        if(permission != null && permission.length() != 0)
            permissionService.setPermission(homeSpaceRef, permissionService.getAllAuthorities(), permission, true);
       // ownableService.setOwner(homeSpaceRef, userName);
       // permissionService.setPermission(homeSpaceRef, permissionService.getOwnerAuthority(), permissionService.getAllPermission(), true);
        permissionService.setInheritParentPermissions(homeSpaceRef, false);
    }

mjlarkin
Champ in-the-making
Champ in-the-making
Here's what I changed in the class ("None" is a custom permission I've defined that has no rights):

     // Admin Authority has full permissions by default (automatic - set in the permission config)
         // give "None" permissionsto the new user
         this.permissionService.setPermission(homeSpaceRef, this.userName, "None", true);
        
        
        
         // by default other users will only have GUEST access to the space contents
         // or whatever is configured as the default in the web-client-xml config
         //String permission = getDefaultPermission();
         //if (permission != null && permission.length() != 0)
         //{
            //this.permissionService.setPermission(homeSpaceRef, permissionService.getAllAuthorities(), permission, true);
        //}
        
         // the new user is the OWNER of their own space and always has full permissions
         //this.ownableService.setOwner(homeSpaceRef, this.userName);
         //this.permissionService.setPermission(homeSpaceRef, permissionService.getOwnerAuthority(), permissionService.getAllPermission(), true);
        
         // now detach (if we did this first we could not set any permissions!)
         this.permissionService.setInheritParentPermissions(homeSpaceRef, false);

As you can see, I've commented out everything except for the assignment of the "None" permission and the disallowing of inheritable permissions.  However, when I create a new user and then "Manage Space Users" on their home space, they are listed with permissions "All, None".  I can't figure out where the All is coming from?  I've search through all the config files and code…what's the deal??

Thanks!