cancel
Showing results for 
Search instead for 
Did you mean: 

Disable 'Create site' link in Alfresco 4.2.e

agey
Champ in-the-making
Champ in-the-making
Hi all,

I want to disable 'Create site' link from My Sites dashlet and dropdown menu Sites. I followed this page of the Alfresco wiki but it doesn't work:

http://wiki.alfresco.com/wiki/Site_Service#Controlling_site_creation_permissions_in_Alfresco_3.4.6_a...

Has anyone tried it in 4.2.e version?

Thanks a lot in advance
7 REPLIES 7

muralidharand
Star Contributor
Star Contributor
Hi,
We are using this option in alfresco 4.1.1 Enterprise Edition.
This will not disable the create site link, rather it will not allow the user's to create new site.
If a non-administrator tries to create a new site, it will throw permission error.

Hope this helps you !

agey
Champ in-the-making
Champ in-the-making
It's true, I had not noticed.

Thank you.

agey
Champ in-the-making
Champ in-the-making
One more question. I want to have this configuration in a jar file. Where should I put the configuration file in the jar to override SiteService_security configuration? I put it in custom-slingshot-application-context.xml but it doesn't work. This is my project structure:

config/alfresco/site-webscripts –> new webscripts
config/alfresco/web-extension –> custom-slingshot-application-context.xml and share-config-custom.xml
config/alfresco/web-extension/site-webscripts –> webscripts that override existing ones
source/web –> css files

Thanks,

kevinr
Star Contributor
Star Contributor
The SiteService_security bean is part of the Alfresco repository bean configuration. So your changes need to be in a *-context.xml file in the alfresco /extension folder - the web-extension folder is only used by the Share web-application.

karan27
Champ in-the-making
Champ in-the-making
how can i create a link of html page with in a html page.

michaelc
Champ on-the-rise
Champ on-the-rise
Create a group GROUP_CreateSiteAdministrator
add your ste creators that are not admins to it.

Modify the my-sites.get.js module

function main()
{
   createSite = false

       var result = remote.call("/api/people/" + stringUtils.urlEncode(user.name) + "?groups=true");
       if (result.status == 200)
          {
           var i;         
          
          // Create javascript objects from the server response
          // This is the User and it also contains all groups.
           var userValue = eval('(' + result + ')');
        
         
           if (userValue.groups.length != 0)
              {

                 for (i = 0; i < userValue.groups.length; i++)
                 {
                      if (userValue.groups[i].itemName == "GROUP_ALFRESCO_ADMINISTRATORS") createSite = true;
                      if (userValue.groups[i].itemName == "GROUP_CreateSiteAdministrator") createSite = true;
                 }
              }           

          }
   
   // Check for IMAP server status
   var result = remote.call("/imap/servstatus"),
      imapServerEnabled = (result.status == 200 && result == "enabled");

   // Prepare the model for the template
   model.imapServerEnabled = imapServerEnabled;
   model.createSite = createSite;
}

main();

then in the HTML file my-sites.get.html.ftl modify to check the createsite flag.
            <span class="first-child">
               <#if createSite>
               <a href="#" id="${id}-createSite-button" class="theme-color-1">
                  <img src="${url.context}/res/components/images/site-16.png" style="vertical-align: text-bottom" />
                  ${msg("link.createSite")}</a>
               </#if>     
            </span>

sscbrian
Champ on-the-rise
Champ on-the-rise
I tried to implement this method in 5.0a, but it doesn't seem to have any effect.  Unsure if I'm doing it wrong.  Is this method compatible with 5.0a?