question

MohamedRiyazM-3281 avatar image
0 Votes"
MohamedRiyazM-3281 asked MichaelHan-MSFT answered

How to populate a page with list/libray permissions of a SarePoint site using JQuery?

I want to list all lists/libraries on a given site in a html table in a web page. I need to achieve this by client code only. No PS codes. please advise. Probably in a tale with columns such as List Name, List URL, Permission inherit Y/N, User ID/Groups - permission (read/edit/full control etc..)

Thanks

office-sharepoint-server-development
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MohamedRiyazM-3281, I am currently doing some research on this, would update as soon as possible.

0 Votes 0 ·
MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @MohamedRiyazM-3281,

You could use the below code to retrieve these information:
100039-getlists2.txt

Result:

100067-image.png



getlists2.txt (2.0 KiB)
image.png (53.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MohamedRiyazM-3281 avatar image
0 Votes"
MohamedRiyazM-3281 answered MichaelHan-MSFT commented

That's great. Only one more thing is missing . I need to see the actual permission given to this list such as User ID/Groups - permission (read/edit/full control etc..) in another column. It seems I need to the RoleDefinitions of each of the lists.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MohamedRiyazM-3281,

Get User/Group Permissions for List is not that easy. You need to use roleAssignments property for each list and retrieve the member,RoleDefinitionBindings in the roleAssignments.

0 Votes 0 ·
MichaelHan-MSFT avatar image
1 Vote"
MichaelHan-MSFT answered

Hi @MohamedRiyazM-3281,

You could try to use JSOM to get the list information and put them in a table, below is my sample for you:

99765-getlists.txt

Test results:

99766-image.png




getlists.txt (1.6 KiB)
image.png (25.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.