PCLM Share Action

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, {});
0 votes

1 answers




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?


0 votes