cancel
Showing results for 
Search instead for 
Did you mean: 

Hide the Create Site option in Alfresco 5.0.b

hsturner
Champ on-the-rise
Champ on-the-rise
Hi we had the Create Site option hidden for all users except administrators in in 4.2.d, When I try to hide the create site in the Sites Drop down and the my sites widget in 5.0.b it is visible and also throws a exception error for my-sites.get.html.ftl when alfresco loads. Also I cannot find the public-services-security-context.xml file to restrict site creation to admins only. 

How do I do this in 5.0.b, or is there a way to restrict site cretion to admins and a special site creators group?
12 REPLIES 12

hgindl
Champ in-the-making
Champ in-the-making
public-services-security-context.xml is in alfresco-repository-5.0.b.jar.

Kind regards,
Hannes

hsturner
Champ on-the-rise
Champ on-the-rise
Hi hindl,
How do I get that file out of the jar file? Or is there some way to prevent users from creating sites without having to extract this file. We also want to hide the Create Site menu item in the Sites Menu in the My Sites widget. We were unable to get this working in 4.2.d, but did get it to work on a test install of 4.2.f. However when I tried moving those modifications in 5.0.b I either got surf error messages and was unable to log into alfresco, or no errors, but the Create Site menu item and link were still visible. Have you been able to hise those links? If you could give specific instructions that would be great.

In order to overwrite the file <strong>public-services-security-context.xml</strong>in Alfresco 5 you should:
  1. Extract the <strong>alfresco-repository-5.0.b.jar</strong>
  2. Copy the file <strong>public-services-security-context.xml</strong> in the next path
  3. ALFRESCO-INSTALL\tomcat\shared\classes\alfresco\extension\
  4. Rename the file e.g <strong>custom-public-services-security-context.xml</strong>
  5. Modify this line
      org.alfresco.service.cmr.site.SiteService.createSite=ACL_ALLOW
    and change <strong>ACL_ALLOW</strong> to  <strong>ACL_METHOD.ROLE_ADMINISTRATOR</strong> or <strong>ACL_METHOD.GROUP_CreatorOfSites</strong>

Thanks midoscofield,

Where ti I find the alfresco-repository-5.0.b.jar file to extract? I downloaded the alfresco-community-5.0.b.zip file but cannot find this jar file.

After Installing <strong>alfresco-community-5.0.b-installer-win-x64.exe</strong> in WIndows ,you find <strong>alfresco-repository-5.0.b.jar</strong>   in this path <strong>ALFRESCO-INSTALL\tomcat\webapps\alfresco\WEB-INF\lib</strong>

i have the file public-services-security-context.xml  and i have renamed it to custom-public-services-security-context.xml after renamed it i have copied it to ALFRESCO-INSTALL\tomcat\shared\classes\alfresco\extension\
and i have edited it and change code to 
org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.ROLE_ADMINISTRATOR

after all steps the create site link still show on users pages ??

is there another steps i must do it to hide create site from users ?

deeps
Champ in-the-making
Champ in-the-making
Hi,

i have written 1 ftl for hiding create site button in menu.
its worked properly.

but after that i have deployed some amp. after that all changes are reverted back.
i have written that ftl inside share folder in alfresco installation directory directly.

and i think i need to do that changes inside eclipse, and i also need to create amp to hide required buttons.
but i don't know where should i write that file inside eclipse. and what will be the sub directory's that i need to create inside eclipse.


so can you help me please.

i am new in alfresco.

your help will really appreciated.

Thanks in Advance

douglascrp
World-Class Innovator
World-Class Innovator
You can find useful information on how to customize Share here http://docs.alfresco.com/community5.0/concepts/dev-extensions-share-surf-extension-modules.html