-
-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy pathget_for_site.py
More file actions
19 lines (15 loc) · 628 Bytes
/
Copy pathget_for_site.py
File metadata and controls
19 lines (15 loc) · 628 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
Return effective user permissions for a SharePoint site.
https://learn.microsoft.com/en-us/sharepoint/dev/apis/permissions-api-reference
"""
from pprint import pprint
from office365.sharepoint.client_context import ClientContext
from tests import test_client_id, test_password, test_site_url, test_tenant, test_username
ctx = ClientContext(test_site_url).with_username_and_password(
tenant=test_tenant,
client_id=test_client_id,
username=test_username,
password=test_password,
)
result = ctx.web.get_user_effective_permissions(ctx.web.current_user).execute_query()
pprint(result.value.permission_levels)