cancel
Showing results for 
Search instead for 
Did you mean: 

Hide 'Create Site'-Link for specific groups or users??

volkerlux
Champ in-the-making
Champ in-the-making
Hello,

i'm wondering if there is an option to hide the "create site" link in the meta navigation for specific user groups or maybe user roles? E.g. Only managers should see this link. But the best way would be to hide this link for specific user-groups. How can this be done ?

regards,
Volker
16 REPLIES 16

kriner
Champ in-the-making
Champ in-the-making
Hello,
There was already a thread describing an implementation for that, but I don't remember which one.

You have to create some files in shared/classes/alfresco/web-extension/site-webscripts/org/alfresco/ to overide the default behaviour.
These are:
1) in sub-directory components/dashlets
my-sites.get.html.ftl
my-sites.get.js
user-welcome.get.html.ftl
user-welcome.get.js
2) in sub-directory  modules/header
sites.get.html.ftl
sites.get.js

I can provide you a tar.gz file containing all these files and assuming that only users declared in the "SiteCreators" group will have the Site creation links in their browser view.
It works on Alfresco Community 3.4b
In the next weeks, I will test it on latest 3.4c version.
You can download the tar.gz file at following location:
ftp://ftp.tls.cena.fr/export/SiteCreation.tar.gz
then go to   shared/classes/alfresco
and: tar zxf your_download_location/SiteCreation.tar.gz
Finally, restart alfresco.

volkerlux
Champ in-the-making
Champ in-the-making
Many, many thanks for this detailed solution and your snippets!
Meanwhile i tried it with a "if user.isAdmin" condition in the my-sites.get.html.ftl, but your approach seems to be much better and more flexible and also comprises the dashlets link.

But i noticed that there is no "user-welcome.get.js" in my original alfresco folder "dashlets"….
EDIT: i should have looked more precisely in your "user-welcome.get.js", its only your additional code in there, so please ignore the sentence above…

the problem can be marked as solved.

thanks again,
Volker

jco
Champ in-the-making
Champ in-the-making
Hi,
the solution which is proposed in this topic is really interesting me, and i hope other users of the Alfresco community.
Is there anyway to make these sources available again ? (the link has expired)

Thankfully !

J.

kriner
Champ in-the-making
Champ in-the-making
Hello,
the tar.gz file is back on the ftp server (link mentioned above).
It is also available now at following link:
http://perso.tls.cena.fr/kriner/SiteCreation.tar.gz

Regards.

jco
Champ in-the-making
Champ in-the-making
Hello Kriner,

Thank you for your quick reply. This has been really usefull to me ! This should be a default behavior in Alfresco.

Thanks again,
J.

jean
Champ in-the-making
Champ in-the-making
Hi kriner,

For information, I just installed your solution on my 4.0d release.
That work perfectly on that version !  :wink:

Thanks again and have a nice day !

Jean

ashex
Champ in-the-making
Champ in-the-making
Hey Everyone,

I've updated this for 4.0d, for the most part it's identical, the only major change is that user-welcome has been replaced by dynamic-welcome. I haven't tested the welcome part yet but it should work. The rest does work.


http://www.mediafire.com/?mspve14j5d823mo


Edit. The dynamic-welcome portion should not be used as it doesn't work properly. Since it's used on multiple pages it breaks the formatting. You're better off just removing the Create Site link inside dynamic-welcome.

dehnax
Champ in-the-making
Champ in-the-making
Hi All,
Thanks for solution. I was test on the community 4.0d with kriner's file. it 's work fine,
but I've make the minor modify to get back on original style menu layout.
and option to show create site on SITECREATORS group.
I will upload after finish testing. please wait.
Cheer,

dehnax
Champ in-the-making
Champ in-the-making
Here is the link update file, test and work on 4.0d
http://www.mediafire.com/?st1ih9ip9q7jqzg

First, create new group name "SITECREATORS"
then change who is able to create sites. in file public-services-security-context.xml
goto (/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/public-services-security-context.xml)
fine and change from
org.alfresco.service.cmr.site.SiteService.createSite=ACL_ALLOW
to
org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.GROUP_SITECREATORS

copy file from download link and paste to
/tomcat/shared/classes/alfresco/web-extension/
next restart alfresco
:mrgreen: