🔍 Code Extractor

class ObjectSharingSettings

Maturity: 36

This class contains the information necessary to read and change the sharing status of a SharePoint object. It also contains a reference to SharePoint specific settings denoted by "SharePointSettings".

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_settings.py
Lines:
14 - 153
Complexity:
moderate

Purpose

This class contains the information necessary to read and change the sharing status of a SharePoint object. It also contains a reference to SharePoint specific settings denoted by "SharePointSettings".

Source Code

class ObjectSharingSettings(Entity):
    """This class contains the information necessary to read and change the sharing status of a SharePoint object.
    It also contains a reference to SharePoint specific settings denoted by "SharePointSettings".
    """

    @property
    def web_url(self):
        """
        The URL pointing to the containing SP.Web object.
        :rtype: str
        """
        return self.properties.get("WebUrl", None)

    @property
    def access_request_mode(self):
        """
        Boolean indicating whether the sharing context operates under the access request mode.
        :rtype: bool
        """
        return self.properties.get("AccessRequestMode", None)

    @property
    def block_people_picker_and_sharing(self):
        """
        Boolean indicating whether the current user can use the People Picker to do any sharing.
        :rtype: bool
        """
        return self.properties.get("BlockPeoplePickerAndSharing", None)

    @property
    def can_current_user_manage_organization_readonly_link(self):
        """
        Boolean indicating whether the current user can create or disable an organization View link.
        :rtype: bool
        """
        return self.properties.get("CanCurrentUserManageOrganizationReadonlyLink", None)

    @property
    def can_current_user_manage_organization_read_write_link(self):
        """
        Boolean indicating whether the current user can create or disable an organization Edit link.
        :rtype: bool
        """
        return self.properties.get(
            "CanCurrentUserManageOrganizationReadWriteLink", None
        )

    @property
    def can_current_user_manage_readonly_link(self):
        """
        Boolean indicating whether the current user can create or disable an anonymous View link.
        :rtype: bool
        """
        return self.properties.get("CanCurrentUserManageReadonlyLink", None)

    @property
    def can_send_email(self):
        """
        Boolean indicating whether email invitations can be sent.
        :rtype: bool
        """
        return self.properties.get("CanSendEmail", None)

    @property
    def can_send_link(self):
        """
        Boolean indicating whether the current user can make use of Share-By-Link.
        :rtype: bool
        """
        return self.properties.get("CanSendLink", None)

    @property
    def is_user_site_admin(self):
        """
        Boolean that indicates whether or not the current user is a site collection administrator.
        :return: bool
        """
        return self.properties.get("IsUserSiteAdmin", None)

    @property
    def list_id(self):
        """
        The unique ID of the parent list (if applicable).
        :rtype: str
        """
        return self.properties.get("ListId", None)

    @property
    def roles(self):
        """
        A dictionary object that lists the display name and the id of the SharePoint regular roles.
        """
        return self.properties.get("Roles", None)

    @property
    def object_sharing_information(self):
        """
        Contains information about the sharing state of a shareable object.
        """
        return self.properties.get(
            "ObjectSharingInformation",
            ObjectSharingInformation(
                self.context,
                ResourcePath("ObjectSharingInformation", self.resource_path),
            ),
        )

    @property
    def sharepoint_settings(self):
        """
        An object that contains the SharePoint UI specific sharing settings.
        """
        return self.properties.get(
            "SharePointSettings",
            SharePointSharingSettings(
                self.context, ResourcePath("SharePointSettings", self.resource_path)
            ),
        )

    @property
    def sharing_permissions(self):
        """
        A list of SharingPermissionInformation objects that can be used to share.
        """
        return self.properties.get(
            "SharingPermissions",
            SharingPermissionInformation(
                self.context, ResourcePath("SharingPermissions", self.resource_path)
            ),
        )

    def get_property(self, name, default_value=None):
        if default_value is None:
            property_mapping = {
                "ObjectSharingInformation": self.object_sharing_information,
                "SharePointSettings": self.sharepoint_settings,
                "SharingPermissions": self.sharing_permissions,
            }
            default_value = property_mapping.get(name, None)
        return super(ObjectSharingSettings, self).get_property(name, default_value)

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Parameter of type Entity

Return Value

Returns unspecified type

Class Interface

Methods

web_url(self) property

Purpose: The URL pointing to the containing SP.Web object. :rtype: str

Returns: None

access_request_mode(self) property

Purpose: Boolean indicating whether the sharing context operates under the access request mode. :rtype: bool

Returns: None

block_people_picker_and_sharing(self) property

Purpose: Boolean indicating whether the current user can use the People Picker to do any sharing. :rtype: bool

Returns: None

can_current_user_manage_organization_readonly_link(self) property

Purpose: Boolean indicating whether the current user can create or disable an organization View link. :rtype: bool

Returns: None

can_current_user_manage_organization_read_write_link(self) property

Purpose: Boolean indicating whether the current user can create or disable an organization Edit link. :rtype: bool

Returns: None

can_current_user_manage_readonly_link(self) property

Purpose: Boolean indicating whether the current user can create or disable an anonymous View link. :rtype: bool

Returns: None

can_send_email(self) property

Purpose: Boolean indicating whether email invitations can be sent. :rtype: bool

Returns: None

can_send_link(self) property

Purpose: Boolean indicating whether the current user can make use of Share-By-Link. :rtype: bool

Returns: None

is_user_site_admin(self) property

Purpose: Boolean that indicates whether or not the current user is a site collection administrator. :return: bool

Returns: See docstring for return details

list_id(self) property

Purpose: The unique ID of the parent list (if applicable). :rtype: str

Returns: None

roles(self) property

Purpose: A dictionary object that lists the display name and the id of the SharePoint regular roles.

Returns: None

object_sharing_information(self) property

Purpose: Contains information about the sharing state of a shareable object.

Returns: None

sharepoint_settings(self) property

Purpose: An object that contains the SharePoint UI specific sharing settings.

Returns: None

sharing_permissions(self) property

Purpose: A list of SharingPermissionInformation objects that can be used to share.

Returns: None

get_property(self, name, default_value)

Purpose: Retrieves property

Parameters:

  • name: Parameter
  • default_value: Parameter

Returns: None

Required Imports

from office365.runtime.paths.resource_path import ResourcePath
from office365.sharepoint.entity import Entity
from office365.sharepoint.sharing.object_sharing_information import ObjectSharingInformation
from office365.sharepoint.sharing.permission_information import SharingPermissionInformation
from office365.sharepoint.sharing.sharepoint_sharing_settings import SharePointSharingSettings

Usage Example

# Example usage:
# result = ObjectSharingSettings(bases)

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class ObjectSharingInformation 76.1% similar

    A class that provides comprehensive information about the sharing state of SharePoint securable objects (documents, list items, sites), including permissions, sharing links, and user access details.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/object_sharing_information.py
  • class SharePointSharingSettings 75.4% similar

    A class representing SharePoint UI-specific sharing settings, providing access to people picker properties and other sharing-related configurations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/sharepoint_sharing_settings.py
  • class SharingInformation 73.4% 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 AccessRequestSettings 69.3% similar

    A class representing access request settings for SharePoint list items, used to retrieve sharing information from securable objects.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/access_request_settings.py
  • class SharingPermissionInformation 68.5% 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
← Back to Browse