1

I have many documents that have different permissions, I would like to have my users be able to see who else can see/edit the documents. I don't want them to be able to change the permissions just be aware of them. It would also be nice for me to quickly see what documents are being used/edited by who.

basically I just want to add a column that is linked to the permission list of the document.

I would appreciate any input

thanks

0

I apologise for being 5 years late to the party, there's no out of the box way to do this.

However, if you're not impartial to a little SPD workflow with some calls to the SharePoint REST API, read on.

Part Zero: Preface

  1. Download, install, and open SPD2013
  2. Navigate to your site and open your desired library

Part One: Create the column

  1. From the library page under “Customization”, click “Edit list columns”
  2. Click “Add new Column” > “Person or Group”
  3. Name the column “Authorised People”
  4. Right-click the column and click “Column Settings”
  5. Change “allow selection” to “People Only”
  6. Ensure “Choose from” is set to “All users”
  7. Tick the box for “Allow multiple values?”
  8. Click OK
  9. Save the library.

Part Two: Retrieve Users with permissions

  1. Back in the library landing page, add a new SharePoint 2013 workflow called “Update Authorised People Column”

    • Make sure to trigger the workflow on Item Creation and Item Change
  2. Change the name of stage 1 (click on “stage 1”) to “Retrieve Item Permissions”

  3. Add a new “Build Dictionary” step. Click “this” then “Add” for each of the following

    • Name: "Accept", Value: "application/json;odata=verbose"
    • Name: "Content-Type", Value: "application/json;odata=verbose
    • Change the Variable: dictionary to a new variable “headers”
  4. Add a new "Call HTTP Web Service" step

    • Click “this” Click the string builder button (the …)
    • Add the following “/_api/web/lists/getByTitle('ListName')/items?$filter=Id eq ('')”
    • Put your cursor between the single quotes after “eq” and click “Add or Change Lookup”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: userId”
    • Click Ok
    • Click Ok
    • Click Ok
    • Change “request” to the variable “headers”
    • Change “response” to a new dictionary called “usersWithPermissionsRaw”
  5. Add a "Get an Item from a Dictionary" step

    • Replace the "item by name or path" with “d/results(0)/SharedWithUsersId”
    • Replace “dictionary” with the “usersWithPermissionsRaw”
    • Change “item” to a new dictionary “userIdsRaw” (note, the json result isn’t read properly so is unformatted, we’ll format it a little later, but that’s why we’ve called this “raw”)

We now have all the users who have access to the list/library item. Next, we'll need to loop through them and get their names.

  1. Add a new stage called “Retrieve Users” and in the “Transition to stage” on the “Retrieve Permissions” stage, add a “Go to stage” step and change “a stage” to “Retrieve Users” stage

  2. Add a new “Count Items in a dictionary” step to the new “Retrieve Users” stage

    • Replace “dictionary” with “userIdsRaw”
    • Leave the output to variable “count”
  3. Put in an “If any value equals value” condition block

    • Click the first “value”
    • Click the “fx” button
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: count”
    • Click Ok
    • Change the “equals” to “greater than”
    • Change the second “value” to “0”
  4. Inside the if block, add a new “Build Dictionary” step.

    • Click “this”
    • Click “Add”
    • Add “userIdsFormatted” to the Name field
    • Set the Type to Dictionary
    • Click the “fx”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: userIdsRaw”
    • Click Ok
    • Click Ok
    • Change the output to new variable “userDictionary”
  5. Add a “Set Workflow Variable” step

    • Change “workflow variable” to a new variable “index’ of type Number
    • Click Ok
    • Change the “value” to 0
  6. Add a “Set Workflow Variable” step

    • Change “workflow variable” to a new variable “usersList” of type String
    • Click Ok
    • Change the “value” to a semi colon
  7. Add a new “Loop with Condition” block, call it “Retrieve User Details”

    • Click the first “value”
    • Click the “fx”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: index”
    • Click Ok
    • Change “equals” to “is less than”
    • Click the “fx”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: count”
    • Click Ok
    • Click Ok
  8. Add a step to "Get an Item from a Dictionary"

    • Click the “item by name or path”
    • Click the string builder button (the …)
    • Add the following “formattedUserIds/('')”
    • Put your cursor between the single quotes and click “Add or Change Lookup”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: index”
    • Click Ok
    • Click Ok
    • Replace “dictionary” with “userDictionary “
    • Change “item” to a new variable “userId” of type string
  9. Add a step to call HTTP Web Service

    • Click “this”
    • Click the string builder button (the …)
    • Add the following “/_api/web/getuserbyid('')”
    • Put your cursor between the single quotes and click “Add or Change Lookup”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: userId”
    • Click Ok
    • Click Ok
    • Click Ok
    • Change Request to the “headers” variable
    • Click on “response” and create a new variable “usersJsonResult” of type dictionary
  10. Add a step to "Get an Item from a Dictionary"

    • Replace the "item by name or path" with “d/Title”
    • Replace “dictionary” with “usersJsonResult“
    • Change “item” to a new variable “user” of type string
    • Click Ok
  11. Add a “Set Workflow Variable” step

    • Change “workflow variable” to “usersList”
    • Click “value”
    • Click the string builder button (the …)
    • Click “Add or Change Lookup”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: usersList”
    • Click Ok
    • Enter a single space after the variable
    • Click “Add or Change Lookup”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: user”
    • Click Ok
    • Enter a semi colon after the user variable
    • Click Ok
  12. Add a “Do Calculation” step

    • Click the first “value”
    • Click the “fx”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: count”
    • Click Ok
    • Change the second “value” to “1”.
    • Leave the output variable as “calc”
  13. Add a “Set Workflow Variable” step

    • Replace “workflow variable” with our “index” variable
    • Click “value”
    • Click the “fx”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: calc”
    • Click Ok

This completes our loop, we now need to bring it all together.

  1. After the loop, add a “Set field in current item” step

    • Change “field” to the “Authorised People” column.
    • Click “value”
    • Click the “fx”
    • Change Data Source to “Workflow Variables and Parameters”
    • Change the Field from Source to “Variable: usersList”
    • Change the Return Field As to “Display Names, Semicolon Delimited”
    • Click Ok
  2. In the “Transition to stage” on the “Retrieve Users” stage, add a “Go to stage” step and change “a stage” to “End of workflow”

  3. Publish the workflow

  4. Test it out

  5. Vote up this answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.