-
Type:
Service Pack Request
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 5.0.1.1
-
Fix Version/s: 5.0.2
-
Component/s: Foundation Java APIs, Search and Indexing (non-UI)
-
Labels:None
-
Bug Priority:
-
ACT Numbers:
00379051, 00452090, 00487040
When changing the permissions during the property editing Solr4 duplicates the indexes.
Attached an AMP and its source code, with a Java Behaviour resetting the node permission on a property update
@Override public void onUpdateProperties(NodeRef nodeRef,Map<QName, Serializable> before, Map<QName, Serializable> after) { logger.debug("BooleanPropertyChangeBehaviour.onUpdateProperties called"); if(nodeService.hasAspect(nodeRef, QName.createQName("my.new.model","customAspect"))){ Boolean beforeVal = (Boolean)before.get(myBooleanProperty); Boolean afterVal = (Boolean)after.get(myBooleanProperty); logger.debug("beforeVal: "+beforeVal); logger.debug("afterVal: "+afterVal); if (!EqualsHelper.nullSafeEquals(beforeVal, afterVal)){ logger.debug("Setting Permissions"); AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName()); permissionService.setInheritParentPermissions(nodeRef, false); permissionService.deletePermissions(nodeRef); permissionService.setPermission(nodeRef, "test_user", PermissionService.CONSUMER, true); } } }
[STEPS TO REPRODUCE]
1. Install Alfresco 5.0.1.1 with Solr 4
2. Apply the attached repo AMP
3. Add in your share-config-custom.xml:
<config evaluator="aspect" condition="my:customAspect"> <forms> <form> <field-visibility> <show id="my:boolean" /> </field-visibility> </form> </forms> </config> <config evaluator="string-compare" condition="DocumentLibrary" > <aspects> <visible> <aspect name="cm:generalclassifiable" /> <aspect name="cm:complianceable" /> <aspect name="cm:dublincore" /> <aspect name="cm:effectivity" /> <aspect name="cm:summarizable" /> <aspect name="cm:versionable" /> <aspect name="cm:templatable" /> <aspect name="cm:emailed" /> <aspect name="emailserver:aliasable" /> <aspect name="cm:taggable" /> <aspect name="app:inlineeditable" /> <aspect name="gd:googleEditable" /> <aspect name="cm:geographic" /> <aspect name="exif:exif" /> <aspect name="audio:audio" /> <aspect name="cm:indexControl" /> <aspect name="dp:restrictable" /> <aspect name="my:customAspect" /> </visible> </aspects> </config>
3. Start Alfresco
4. Log into Share with admin user
5. Create a user called "test_user"
6. Create a file in the Document Library called "permissiontest"
7. Apply the "my:customAspect" to the previously created node
8. Edit properties and change the value of the property "my:boolean"
9. Save
10. Repeat steps 8 & 9 a couple of time
11. Go to the Admin Tool page -> Node Browser
12. Perform the following searches:
+@cm\:name:"permissiontest"
+@cm\:name:"permissiontest" +@my\:boolean:true
+@cm\:name:"permissiontest" +@my\:boolean:value
[Expected behaviour]
Searches should return 1 or 0 documents
[Observed behaviour]
Searches return multiple results, always the same node
[Notes]
- It doesn't seem to be reproducible with Solr1 and Alfresco5.0.1
- Workaround:
Removing all permissions one by one
Set<AccessPermission> perms = permissionService.getAllSetPermissions(nodeRef);
for (AccessPermission perm : perms) { permissionService.deletePermission(nodeRef, perm.getAuthority(), perm.getPermission()); }instead of
permissionService.deletePermissions(nodeRef);
Does NOT cause the issue