As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
It should be possible to add EVERYONE to EMAIL_CONTRIBUTORS. If it doesn't work then please make sure its raised in JIRA.
Hi mpeters ,If that is the case you should write a scheduler which will run in a time interval and will execute a business logic written in java class.
Thanks for your responses. I found a couple of issues that were fixed and validated in 3.4 Last September. And in addition there is a work-around for this problem which is to use Alfresco Explorer. What version are you testing on?
I'm thinking about this easy solution: creating the javascript you recommended in your first response and then call it by a rule assigned to the "User Homes" space whenever an Object will be created, changed or deleted. So when the LDAP sync is executed and a new user is imported, then a new user space will be created and the rule triggers the script to be executed. Ok, if there are 5 new user, the script will run 5 times, but I tend to accept this "little" resource overusage.
Échec de la création du groupe '02230003 Wrapped Exception (with status template): 02230382 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/groups/children.post.js': 02230381 Authorities of the type EVERYONE may not be added to other authorities'.
Hi everybody,I have the same issue … on Alfresco 3.4.b Community.[…]Can you confirm this behavior ?
// define the names of source and target group var nameSourcegroup = 'EVERYONE'; var nameTargetgroup = 'ALLUSERS'; // get the source group *PROBLEM HERE* var groupSource = people.getGroup('GROUP_' + nameSourcegroup); if (groupSource) { // get the members of the source group var membersSourcegroup = people.getMembers(groupSource); if (membersSourcegroup) { // get the target group var groupTarget = people.getGroup('GROUP_' + nameTargetgroup); // if not existent, create the target group if (!groupTarget) { groupTarget = people.createGroup(nameTargetgroup); }; if (groupTarget) { // loop over all members of the source group and add them to the target group for(var i = 0; i < membersSourcegroup.length; i++) { people.addAuthority(groupTarget, membersSourcegroup[i]); }; }; }; };
I think it would be far easier just to add EVERYONE to EMAIL_CONTRIBUTORS.
// define the names target group var nameTargetgroup = 'ALLUSERS'; // get the members of the source group // var foundUsers = search.luceneSearch("QNAME:\"usr:user\""); var foundUsers = search.luceneSearch("user://alfrescoUserStore", "QNAME:\"usr:user\""); if (foundUsers.length) { // get the target group var groupTarget = people.getGroup('GROUP_' + nameTargetgroup); // if not existent, create the target group if (!groupTarget) { groupTarget = people.createGroup(nameTargetgroup); }; if (groupTarget) { // loop over all found users from the lucene search and add them to the target group for(var i = 0; i < foundUsers.length; i++) { people.addAuthority(groupTarget, foundUsers[i]); }; }; };
As an aside, I think the current share GUI incorrectly conflates the two concepts of "role" and "group". Alfresco really needs to rework this GUI so that the two concepts are clearly separated out.
var nameTargetgroup = 'EMAIL_CONTRIBUTORS'; var groupPrefix="GROUP_"; function userBelongsToGroup (_person, _groupTarget) { var found = false; var containerGroups = people.getContainerGroups(_person); for (var i = 0; i < containerGroups.length; i++) { if (containerGroups[i].properties["cm:authorityName"] == _groupTarget.properties["cm:authorityName"]) { found = true; break; }; //logger.log(containerGroups[i].properties["cm:authorityName"]); }; return found; } //get members var members = search.luceneSearch("workspace://SpacesStore", "TYPE:\"cm:person\""); if (members) { // get target group var groupTarget = people.getGroup(groupPrefix + nameTargetgroup); if (groupTarget) { // loop over all members of the source group and add them to the target group for(var i = 0; i < members.length; i++) { var person = members[i]; if(people.isAdmin(person)) continue; if(people.isGuest(person)) continue; if (userBelongsToGroup (person, groupTarget)) continue; var email = person.properties["cm:email"]; if (!email || (0 == email.length)) continue; logger.log(person.properties["cm:userName"] + " is NOT member of EMAIL_CONTRIBUTORS group. Adding…"); try { people.addAuthority(groupTarget, person); } catch (ex) { logger.log("ABORT: exception ocurred: " + ex); break; }; }; }; };