🔍 Code Extractor

class PermissionCollection

Maturity: 51

A SharePoint client value class representing a collection of permissions for a securable object, containing LinkInfo and PrincipalInfo objects for users/groups with access.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/permission_collection.py
Lines:
4 - 14
Complexity:
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

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharingPermissionInformation 73.6% similar

    A class representing sharing permission information for SharePoint entities such as groups or roles, providing access to permission metadata and default permission status.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/permission_information.py
  • class SharingAbilities 72.0% similar

    Represents the matrix of possible sharing abilities for direct sharing and tokenized sharing links along with the state of each capability for the current user in SharePoint.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/abilities.py
  • class SharingLinkAccessRequest 71.0% similar

    A data class representing extended values required for requesting access to SharePoint objects exposed through tokenized sharing links, including password and access persistence options.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/links/access_request.py
  • class SharingInformation 70.3% similar

    Represents sharing information for a SharePoint securable object, providing access to sharing settings, picker configurations, sharing abilities, and link templates.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/information.py
  • class SharingLinkAbilities 69.8% similar

    A data class representing the set of capabilities for tokenized sharing links in SharePoint, indicating which sharing operations are enabled or disabled for the current user.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/link_abilities.py
← Back to Browse