Skip to content

Commit 5936441

Browse files
committed
SharePoint examples updates
1 parent 0135f15 commit 5936441

File tree

4 files changed

+34
-25
lines changed

4 files changed

+34
-25
lines changed

examples/sharepoint/export/__init__.py

Whitespace-only changes.

examples/sharepoint/files/get_properties.py

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Retrieves basic file properties
3+
"""
4+
5+
from office365.sharepoint.client_context import ClientContext
6+
from tests import test_client_credentials, test_team_site_url
7+
8+
ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
9+
file_url = "SitePages/Home.aspx"
10+
file = ctx.web.get_file_by_server_relative_url(file_url).get().execute_query()
11+
12+
print("File size: ", file.length)
13+
print("File name: ", file.name)
14+
print("File url: ", file.serverRelativeUrl)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from office365.runtime.client_value import ClientValue
2+
3+
4+
class Role(ClientValue):
5+
"""
6+
Specifies a set of abstract roles that a user can be assigned to share a securable object in a document library
7+
"""
8+
9+
View = 1
10+
"""The user can only read a securable object."""
11+
12+
Edit = 2
13+
"""The user can edit or read a securable object, but cannot delete it."""
14+
15+
Owner = 3
16+
"""The user is an owner of a securable object and can manage permissions, and edit, read or delete the object."""
17+
18+
@property
19+
def entity_type_name(self):
20+
return "SP.Sharing.Role"

0 commit comments

Comments
 (0)