protected NodeRef getNodeRef(WebScriptRequest req)
{
// NOTE: This web script must be executed in a HTTP Servlet environment
if (!(req instanceof WebScriptServletRequest))
{
throw new WebScriptException("Content retrieval must be executed in HTTP Servlet environment");
}
HttpServletRequest httpReq = ((WebScriptServletRequest)req).getHttpServletRequest();
// locate the root path
String path = (String) httpReq.getParameter("path");
if(path == null)
{
path = "/images";
}
if(path.startsWith("/"))
{
path = path.substring(1, path.length());
}
// build a path elements list
List<String> pathElements = new ArrayList<String>();
StringTokenizer tokenizer = new StringTokenizer(path, "/");
while(tokenizer.hasMoreTokens())
{
String childName = (String) tokenizer.nextToken();
pathElements.add(childName);
}
// look up the child
NodeRef nodeRef = null;
try
{
NodeRef companyHomeRef = this.repository.getCompanyHome();
nodeRef = getFileFolderService().resolveNamePath(companyHomeRef, pathElements).getNodeRef();
}
catch(FileNotFoundException fnfe)
{
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Unable to locate path");
}
if (nodeRef == null)
{
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Unable to locate path");
}
return nodeRef;
}
java.util.Set findNodesByAssignedPermission(java.lang.String authority, java.lang.String permission, boolean allow, boolean includeContainingAuthorities, boolean exactPermissionMatch)La cuestión es que he revisado el PermissionService (http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/security/PermissionSe...) y esos métodos se encuentran Deprecated (desaprobados, pasados de moda ) y no sé porqué razón ni por qué se pueden sustituir.
Find all the nodes where the current user has explicitly been assigned the specified permission.
java.util.Set findNodesByAssignedPermissionForCurrentUser(java.lang.String permission, boolean allow, boolean includeContainingAuthorities, boolean includeContainingPermissions)
Find all the nodes where the current user has explicitly been assigned the specified permission.
<#list node.permissions as p>
<tr><td> ${p} </td></tr>
</#list>
pero yo no quiero mostrarlos todos, sino dentro del list comprobar si la cadena "GROUP_XXXXX" se encuentra en lo que me devuelve p, y si está pues lo imprimo y sino pues nada, y así solo me mostrará los de ese grupo que yo quiero, pero me estoy volviendo loca buscando pero lucene no tiene ninguna función con esa funcionalidad, no? Bueno se me olvidaba comentar que esto lo tengo ahora en una template, lo estoy probando ahí poniéndole a mano un grupo, para una vez que lo consiga pues pasarlo al webscript, desde el cual cogeremos el grupo que nos pasen.<!– webscript que partiendo de el space CCC, nos da los spaces a los que tiene permiso (y nos indica qué permiso) un grupo determinado, pasado por parámetro –>
<#macro dir node depth>
<#if node.isContainer>
<#if node.permissions?exists>
<#list node.permissions as p>
<#if p?contains(g)>
<tr> <td align='left'>${p?split(";")[2]}</td>
<td align='leftr'>${node.name}</td>
<td>${node.displayPath?substring(25)}/${node.name}</td>
</tr>
</#if>
</#list>
<#else>
<td> no tiene permisos</td>
</#if>
</tr>
<#else>
<b>El space <i>${folderName}</i> NO existe …</b>
</#if>
<#list node.children as child>
<#if child.isContainer && node.children?size != 0>
<@dir node=child depth=depth+1/>
</#if>
</#list>
</#macro>
<!– create a table and start traversing the space structure –>
<html>
<body>
<#assign folderName="User Homes/CCC" />
<#assign node=folderName>
<img src="${url.context}/images/logo/AlfrescoLogo32.png" alt="Alfresco" />
<#if args.group?exists>
<#if grupo?exists>
<#if companyhome.childByNamePath[folderName]?exists>
<#assign folderObj=companyhome.childByNamePath[folderName]>
<#assign g=grupo.properties["usr:authorityName"] +";">
<b>Spaces a los que puede acceder el grupo: </b> ${grupo.properties["usr:authorityName"]}<br>
<br><br>
<table border="1">
<tr><th>Permiso</th><th>Space</th><th>Ruta</th></tr>
<@dir node=folderObj depth=0/>
</table>
</#if>
<#else>
<b>Spaces a los que puede acceder el grupo: </b> El grupo "${args.group}" no existe<br>
</#if>
</#if>
</body>
</html>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.