class PermissionCollection
A SharePoint client value class representing a collection of permissions for a securable object, containing LinkInfo and PrincipalInfo objects for users/groups with access.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/permission_collection.py
4 - 14
simple
Purpose
This class serves as a data container for permission information retrieved from SharePoint when calling GetSharingInformation with expanded permissionsInformation property. It encapsulates permission details including users, groups, and site administrators who have access to a SharePoint list item or other securable object. The class inherits from ClientValue, making it part of the Office365 REST API client framework for handling SharePoint data structures.
Source Code
class PermissionCollection(ClientValue):
"""
This class is returned when Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation
is called with the optional expand on permissionsInformation property. It contains a collection of LinkInfo and
PrincipalInfo objects of users/groups that have access to the list item and also the site administrators who have
implicit access.
"""
@property
def entity_type_name(self):
return "SP.Sharing.PermissionCollection"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
__init__: The constructor parameters are inherited from ClientValue base class. Typically accepts keyword arguments that map to the properties of the SharePoint PermissionCollection entity type.
Return Value
Instantiation returns a PermissionCollection object that represents SharePoint permission data. The object itself is a ClientValue that can be serialized/deserialized for communication with SharePoint REST API. The entity_type_name property returns the string 'SP.Sharing.PermissionCollection' which identifies this object type in SharePoint's type system.
Class Interface
Methods
@property
def entity_type_name(self) -> str
property
Purpose: Returns the SharePoint entity type name for this permission collection, used for type identification in the SharePoint REST API
Returns: The string 'SP.Sharing.PermissionCollection' which identifies this object type in SharePoint's type system
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
entity_type_name |
str | Read-only property that returns 'SP.Sharing.PermissionCollection' for SharePoint type identification | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.sharing.permission_collection import PermissionCollection
Usage Example
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.sharing.securable_object_extensions import SecurableObjectExtensions
# Authenticate and get context
ctx = ClientContext(site_url).with_credentials(credentials)
# Get a list item
list_item = ctx.web.lists.get_by_title('Documents').items.get_by_id(1)
# Get sharing information with permissions expanded
sharing_info = SecurableObjectExtensions.get_sharing_information(
list_item,
expand=['permissionsInformation']
).execute_query()
# Access the PermissionCollection
permissions = sharing_info.permissionsInformation
print(f"Permission type: {permissions.entity_type_name}")
# The collection contains LinkInfo and PrincipalInfo objects
# representing users, groups, and administrators with access
Best Practices
- This class is typically not instantiated directly by users but returned from SharePoint API calls
- Use GetSharingInformation with expand=['permissionsInformation'] to retrieve instances of this class
- The class is immutable and represents a snapshot of permissions at query time
- Always execute the query on the parent context before accessing permission data
- This class inherits serialization/deserialization behavior from ClientValue for REST API communication
- The entity_type_name property is used internally by the Office365 framework for type identification
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SharingPermissionInformation 73.6% similar
-
class SharingAbilities 72.0% similar
-
class SharingLinkAccessRequest 71.0% similar
-
class SharingInformation 70.3% similar
-
class SharingLinkAbilities 69.8% similar