cancel
Showing results for 
Search instead for 
Did you mean: 

Private Site activities feed generator

vrugginkj
Champ in-the-making
Champ in-the-making
Hello,
I'm trying to understand the dashlet Site activities and the more I search, the less I understand Smiley Happy)
  This is what I found until now :
  If you add-change-delete a document within the share UI, for each transaction you do, a record is added in the table alf_activity_post with a status POSTED-PENDING (don^t know which is first, but it isn't really important I guess)

There is some server task which every xx seconds (30 seconds on our system) handles these records, and for each record, it writes records in the table alf_activity_feed and here I made the following observations :

- If the site is public it seems to be OK and activity on the documents is added for each site-member. In other words : for each site-member a record is added in alf_activity_feed where feed_user_id = site-member.
- If the site is private, and the user is Admin AND a site-member, it's also OK but there's also a record with feed_user_id = ' ' ??
- If the site is private, and the user is just a simple site-member IT'S NOT OK !

This last behaviour seems strange to me, as it is said in the documentation somewhere that it should work if the user is a site-member OR an administrator… Smiley Sad((. Did they mix up AND-OR somewhere or is there some configuration missing ? By the way, there is a table named alf_activity_feed_control, which is empty…

Any help would be appreciated !


I tested it with Enterprise 4.1.2/MySql and Community 4.2C/PostGreSQL : same result.
4 REPLIES 4

vrugginkj
Champ in-the-making
Champ in-the-making
Select 2 lines from alf_activity_feed table for the private site :
2174;67;"2013-06-12 15:05:32.995";"{"parentNodeRef":"workspace://SpacesStore/30c4583e-15f5-42f5-925e-4d526a771b19","lastName":"Vruggink","title":"application.ini","page":"document-details?nodeRef=workspace://SpacesStore/292fb813-44ff-4be3-b524-8bffb47ede59","nodeRef":"workspace://SpacesStore/292fb813-44ff-4be3-b524-8bffb47ede59","firstName":"Jaco"}";"''";"org.alfresco.documentlibrary.file-added";"json";"commissions";"documentlibrary";"vrugginkj";"2013-06-12 15:06:03.931"
2175;67;"2013-06-12 15:05:32.995";"{"parentNodeRef":"workspace://SpacesStore/30c4583e-15f5-42f5-925e-4d526a771b19","lastName":"Vruggink","title":"application.ini","page":"document-details?nodeRef=workspace://SpacesStore/292fb813-44ff-4be3-b524-8bffb47ede59","nodeRef":"workspace://SpacesStore/292fb813-44ff-4be3-b524-8bffb47ede59","firstName":"Jaco"}";"adminor";"org.alfresco.documentlibrary.file-added";"json";"commissions";"documentlibrary";"vrugginkj";"2013-06-12 15:06:03.943"

vrugginkj
Champ in-the-making
Champ in-the-making
https://issues.alfresco.com/jira/browse/MNT-2220?page=com.atlassian.jira.plugin.system.issuetabpanel...

This Jira explains everything. Unfortanately all our user accounts contain uppercase letters Smiley Sad((


vrugginkj
Champ in-the-making
Champ in-the-making
I changed all the members of my private site, and changed upper-case characters to lower-case. It's working better now.
- file-added activity : OK
- folder-added activity : OK
- file-updated activity : OK

- file-deleted and folder-deleted activity : Only the user that makes the action is in the alf_activity_feed table. Why not the other site-members. ?
Obviously this has nothing to do with private/public site. I tested it for both, and for deletion it's the same thing for both cases…

I think the problem is that once a node is deleted (and has moved in the trash), other site-members don't have permission on it anymore (see the code below, where we check permissions on the node checkNodeRef).

——————————————————————————————————————-
    private boolean canReadImpl(final String connectedUser, final NodeRef nodeRef) throws Exception
    {
        // check for read permission
        long start = System.currentTimeMillis();

        try
        {
            // note: deleted node does not exist (hence no permission, although default permission check would return true which is problematic)
            final NodeRef checkNodeRef;
            if (nodeService.exists(nodeRef))
            {
                checkNodeRef = nodeRef;
            }
            else
            {
                // TODO: require ghosting - this is temp workaround (we should not rely on archive - may be permanently deleted, ie. not archived or already purged)
                NodeRef archiveNodeRef = new NodeRef(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, nodeRef.getId());
                if (!nodeService.exists(archiveNodeRef))
                {
                    return false;
                }
                checkNodeRef = archiveNodeRef;
            }

            if (connectedUser.equals(""))
            {
                // site feed (public site)
                Set<AccessPermission> perms = permissionService.getAllSetPermissions(checkNodeRef);
                for (AccessPermission perm : perms)
                {
                    if (perm.getAuthority().equals(PermissionService.ALL_AUTHORITIES) &&
                        perm.getAuthorityType().equals(AuthorityType.EVERYONE) &&
                        perm.getPermission().equals(PermissionService.READ_PERMISSIONS) &&
                        perm.getAccessStatus().equals(AccessStatus.ALLOWED))
                    {
                        return true;
                    }
                }
                return false;
            }
            else
            {
                // user feed
                return AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Boolean>()
                {
                    public Boolean doWork() throws Exception
                    {
                        return (permissionService.hasPermission(checkNodeRef, PermissionService.READ) == AccessStatus.ALLOWED);
                    }
                }, connectedUser);
            }
        }
        finally
        {
            if (logger.isDebugEnabled())
            {
                logger.debug("canRead: " + nodeRef + " in " + (System.currentTimeMillis() - start) + " msecs");
            }
        }
    }

vrugginkj
Champ in-the-making
Champ in-the-making
I confirm the problem of read-permission on the Trash. Once the content is deleted and the node has moved to the trash, Nobody has read-permission anymore.
Using the JavaScript console I added read-permission for everyone (I know, not quite secure) on the trash-node, and now the records on the activity "file-deleted" are generated in the table alf_actitivy_feed…
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.