cancel
Showing results for 
Search instead for 
Did you mean: 

Site has no managers ugh!!!

jriker1
Champ in-the-making
Champ in-the-making
Had a site that wasn't using synching with AD originally and now am.  As part of the process it blew away all users not in a particular group and that included someone who was the only manager of a site we need.  Is there a way to manually add someone as a site admin?  I am a default Alfresco adminstrator but I can't add users or modify the site configuration regardless.

Thanks for any input.

JR
12 REPLIES 12

doiheartwentyon
Champ in-the-making
Champ in-the-making
I lost all my site memberships after a migration to another server and subsequent ldap/kerberos sync.
The above script works, but when I tried to extend it to give me managership of all sites like this
var sites = siteService.listSites("","",0);

for (var i=0; i<sites.length(); i++) {
    sites[i].setMembership("dlinton","SiteManager");
}

I get the error 08250023 Java class "[Lorg.alfresco.repo.site.script.Site;" has no public instance field or method named "__noSuchMethod__".

Does listSites not return Site objects then ?

ebogaard
Champ on-the-rise
Champ on-the-rise
Isn't it maybe possible to add this functionality to Alfresco?
It seems to me that there is often a situatiation where this is needed. For example, when someone leaves the company and there is no other SiteManager.

mcox
Champ in-the-making
Champ in-the-making
I came across what seems to be a similar situation while trying out Share.

I deleted a Share site through Share and later recovered it by mistake through Explorer.

However this broke searching for sites through Share which failed with:

01010006 Wrapped Exception (with status template): 01010031 Error during processing of the template 'Method public org.alfresco.repo.jscript.ScriptableHashMap org.alfresco.repo.site.script.Site.listMembers(java.lang.String,java.lang.String,int) threw an exception when invoked on org.alfresco.repo.site.script.Site@1240567'. Please contact your system administrator.

This seems to be because there was no SiteManager for the recovered site, which was merely reinstated as an Alfresco space.

The site also could not be accessed or deleted through Share and Explorer prevents you from deleting spaces under Share.

Trying to fix an orphaned site like this by adding a site manager using something like:

var site = siteService.getSite("XXXX");
site.setMembership("admin", "SiteManager");

does not work because the actual groups controlling site access are not recovered when the space is. So it throws:

Failed to run Actions due to error: 01010033 Failed to execute script 'workspace://SpacesStore/75dd0795-6b70-45ba-bb30-d00668091313': 01010032 An authority was not found for GROUP_site_XXXX_SiteManager

Finally I managed to fix this by recreating the site groups and adding admin as a site manager using this code (simplified):

  
  var siteGroup =  groups.createRootGroup(  "site_" + sitename, sitename );

  siteGroup.createGroup(  "site_" + sitename + "_SiteManager", sitename ); 
  siteGroup.createGroup(  "site_" + sitename + "_SiteCollaborator", sitename );
  siteGroup.createGroup(  "site_" + sitename + "_SiteContributor", sitename );
  siteGroup.createGroup(  "site_" + sitename + "_SiteConsumer", sitename );

  var site = siteService.getSite( sitename );
  site.setMembership( "admin", "SiteManager");

I am not sure if the site is fully functional after this but at least you can delete it..