How to disable site creation by users in Alfresco

To block users from creating new sites on Alfresco, navigate to the tomcat/webapps/alfresco/WEB-INF/classes/alfresco folder

cd tomcat/webapps/alfresco/WEB-INF/classes/alfresco

make a copy of the public-services-security-context.xml file

sudo cp public-services-security-context.xml public-services-security-context.xml.original

Edit the public-services-security-context.xml file

sudo vi public-services-security-context.xml

change the lines as highlighted under:

    <!-- ============ -->

    <!-- Site Service -->

    <!-- ============ -->

    <bean id="SiteService_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor">

        <property name="authenticationManager"><ref bean="authenticationManager"/></property>

        <property name="accessDecisionManager"><ref local="accessDecisionManager"/></property>

        <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>

        <property name="objectDefinitionSource">

            <value>

               org.alfresco.service.cmr.site.SiteService.cleanSitePermissions=ACL_NODE.0.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.createContainer=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.ROLE_ADMINISTRATOR

               org.alfresco.service.cmr.site.SiteService.deleteSite=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.findSites=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.getContainer=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.getMembersRole=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.getSite=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.getSiteGroup=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.getSiteRoleGroup=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.getSiteRoles=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.getSiteRoot=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.hasContainer=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.hasCreateSitePermissions=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.isMember=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.listMembers=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.listSites=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties

               org.alfresco.service.cmr.site.SiteService.removeMembership=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.setMembership=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.updateSite=ACL_ALLOW

               org.alfresco.service.cmr.site.SiteService.*=ACL_ALLOW

            </value>

        </property>

    </bean>

Restart the Alfresco server and you have blocked access to creating sites. the Alfresco admin group still has access to creating sites.