cancel
Showing results for 
Search instead for 
Did you mean: 

PCLM Share Action

Eric_Atencio
Champ on-the-rise
Champ on-the-rise

Wondering if anyone has some advice for me. We have a share action that allows users to quickly share internally, the action allows the selection of users and it verifies that they don't have access to login to the current document. If the user can authenticate, no action is taken, but if a user can't, the action gave them Read. We changed Read so that it only allowed system access but the user couldn't see any files. We needed to have a basic membership so that users could browse and be added to documents. Does anyone have any idea how to change this authentication:

  try {
      // check if the user has read access to the  document
      input = Auth.LoginAs(input, {'name': username});
      input = Auth.Logout(input, {});
    } catch(error) {
      // if no access, grant read permission
      if (currentUser.name === username) {
     

      }
      input = Auth.LoginAs(input, {});
      input = Document.AddPermission(input, {
        'acl': 'sharing',
	'permission': 'ReadBrowse',
	'username': username
      });
      input = Auth.Logout(input, {});
    }

1 REPLY 1

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

If you need to be able to browse to the document, you need to retrieve all parents (until Root) and give READ access to them (if not already provided). Is it want you're looking for?

Regards

Getting started

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.