Colleagues, I found the solution.
community-home.jsp and collection-home.jsp files it is necessary to insert
the following line in the header:
<% @ page import = "org.dspace.eperson.EPerson"%>
then you can use the function that validates the logged in user:
// Is anyone logged in?
EPerson user = (EPerson) request.getAttribute ("dspace.current.user");
That way, you can manipulate any html attribute to be shown to the user.
So, I do to manipulates statistics. In community-home.jps, I added the
following rule:
<%
if(user!=null)
{
%>
<a class="statisticsLink btn btn-info" href="<%=
request.getContextPath() %>/handle/<%= community.getHandle()
%>/statistics"><fmt:message
key="jsp.community-home.display-statistics"/></a>
<%
}
%>
and collection-home.jsp, I added the following rule:
<%
if(user!=null)
{
%>
<a class="statisticsLink btn btn-info" href="<%=
request.getContextPath() %>/handle/<%= collection.getHandle()
%>/statistics"><fmt:message
key="jsp.collection-home.display-statistics"/></a>
<%
}
%>
Em seg., 3 de fev. de 2020 às 15:44, Lucas Silveira <
[email protected]> escreveu:
> Dear colleagues, I need to remove the statistics button from pages where
> the user is not logged in.
> However, dspace only allows you to enable and disable access, but the
> button is visible to everyone.
> Does anyone know how to do?
>
> Thanks in advance
>
> --
> All messages to this mailing list should adhere to the DuraSpace Code of
> Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dspace-tech/1fef345c-ca08-4e85-8993-05287fc64a0f%40googlegroups.com
> <https://groups.google.com/d/msgid/dspace-tech/1fef345c-ca08-4e85-8993-05287fc64a0f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
All messages to this mailing list should adhere to the DuraSpace Code of
Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/CAHHcpFziESaa3C5BYC0FkzLLPZfKKN%2Bb%3DmxdJbSOZfDmMu9L6A%40mail.gmail.com.