11-02-2009 02:15 PM
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. */
}
12-13-2009 06:26 AM
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.