cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with owner permission

mrey
Champ in-the-making
Champ in-the-making
Hi there

Can somebody help me?

I´m tryin with an action to change permission in an space to consumer for all the users, included the user who exectutes the action, and the spaces owner.

We use this method
     private void CambiarPermisosLectura() {
          // Este método cambia los permisos del espacio que se ha cerrado a
          // SOLO LECTURA
         
             NodeRef folderNodeRef = nodoEsp.getNodeRef();
             String usuActual = this.services.getAuthenticationService().getCurrentUserName();
             authenticationComponent.setSystemUserAsCurrentUser();
            
             services.getPermissionService().setInheritParentPermissions(folderNodeRef, false);
             Set<AccessPermission> permisos = services.getPermissionService().getAllSetPermissions(folderNodeRef);
             Iterator it = permisos.iterator();
            
             while (it.hasNext()){
               
                AccessPermission acceso = (AccessPermission)it.next();
                if(acceso.getAuthority().equals("admin")){
                   services.getPermissionService().clearPermission(folderNodeRef, acceso.getAuthority());
                   services.getPermissionService().setPermission(folderNodeRef,  acceso.getAuthority(), PermissionService.CONSUMER, true);

                }
             }
             authenticationComponent.clearCurrentSecurityContext();
           authenticationComponent.setCurrentUser(usuActual);
          /* where "folderNoderef" is the Noderef of the given space. */
       }

It works good except the space's owner, who continues with owner`s permission.

Could I change the owners permission?
Change the owner?

Thank you very much.
1 REPLY 1

zaizi
Champ in-the-making
Champ in-the-making
Create a systems account and assign ownership to that account or to the systems account.

Alternative is to modify the permission model, but that might affect other things.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.