Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

61354: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3)
      61287:  Merged DEV to V4.2-BUG-FIX (4.2.2)
         59996: MNT-10366: Share link does not work for consumer/contributor 
           - Run as system user the addition of "shared" aspect to a node.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62412 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-12 15:12:00 +00:00
parent 2a9600f26c
commit 72a3ae93d4

View File

@@ -183,7 +183,7 @@ public class QuickShareServiceImpl implements QuickShareService, NodeServicePoli
@Override
public QuickShareDTO shareContent(NodeRef nodeRef)
public QuickShareDTO shareContent(final NodeRef nodeRef)
{
checkEnabled();
@@ -203,11 +203,19 @@ public class QuickShareServiceImpl implements QuickShareService, NodeServicePoli
UUID uuid = UUIDGenerator.getInstance().generateRandomBasedUUID();
sharedId = Base64.encodeBase64URLSafeString(uuid.toByteArray()); // => 22 chars (eg. q3bEKPeDQvmJYgt4hJxOjw)
Map<QName,Serializable> props = new HashMap<QName,Serializable>(2);
final Map<QName, Serializable> props = new HashMap<QName, Serializable>(2);
props.put(QuickShareModel.PROP_QSHARE_SHAREDID, sharedId);
props.put(QuickShareModel.PROP_QSHARE_SHAREDBY, AuthenticationUtil.getRunAsUser());
nodeService.addAspect(nodeRef, QuickShareModel.ASPECT_QSHARE, props);
// consumer/contributor should be able to add "shared" aspect (MNT-10366)
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
{
public Void doWork()
{
nodeService.addAspect(nodeRef, QuickShareModel.ASPECT_QSHARE, props);
return null;
}
});
final NodeRef tenantNodeRef = tenantService.getName(nodeRef);