🔍 Code Extractor

class PickerSettings

Maturity: 46

Configuration settings class for the SharePoint client people picker control, providing access to picker behavior settings and query configurations.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/picker_settings.py
Lines:
7 - 32
Complexity:
simple

Purpose

PickerSettings is a data entity class that encapsulates configuration options for SharePoint's people picker UI control. It manages settings that control how the picker resolves user identities, including whether it accepts email addresses and what query parameters to use. This class inherits from Entity and provides read-only property access to picker configuration data stored in the underlying properties dictionary.

Source Code

class PickerSettings(Entity):
    """
    This class contains configuration settings for the client people picker control hosted
    by the SharePoint sharing UI.
    """

    @property
    def allow_email_addresses(self):
        """
        Boolean value indicating whether the picker control will allow the resolution of arbitrary email addresses.
        """
        return self.properties.get("AllowEmailAddresses", None)

    @property
    def allow_only_email_addresses(self):
        """
        Boolean value indicating whether the picker control will only allow the resolution of email addresses.
        """
        return self.properties.get("AllowOnlyEmailAddresses", None)

    @property
    def query_settings(self):
        """
        The query settings to be used by the picker control.
        """
        return self.properties.get("QuerySettings", PeoplePickerQuerySettings())

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

Entity_base_class: Inherits from Entity base class which provides the underlying properties dictionary and entity management functionality. No explicit __init__ parameters are defined in this class, so initialization follows the parent Entity class pattern.

Return Value

Instantiation returns a PickerSettings object that provides property-based access to configuration settings. Properties return: allow_email_addresses (bool or None), allow_only_email_addresses (bool or None), and query_settings (PeoplePickerQuerySettings object or default instance).

Class Interface

Methods

@property allow_email_addresses(self) -> bool | None property

Purpose: Returns whether the picker control allows resolution of arbitrary email addresses

Returns: Boolean value (True/False) indicating if email addresses are allowed, or None if not configured

@property allow_only_email_addresses(self) -> bool | None property

Purpose: Returns whether the picker control only allows resolution of email addresses (no other identity types)

Returns: Boolean value (True/False) indicating if only email addresses are allowed, or None if not configured

@property query_settings(self) -> PeoplePickerQuerySettings property

Purpose: Returns the query settings configuration to be used by the picker control

Returns: PeoplePickerQuerySettings object containing query configuration, returns a default instance if not present in properties

Attributes

Name Type Description Scope
properties dict Inherited from Entity base class; stores the underlying configuration data as key-value pairs (AllowEmailAddresses, AllowOnlyEmailAddresses, QuerySettings) instance

Dependencies

  • office365.sharepoint.entity
  • office365.sharepoint.ui.applicationpages.peoplepicker.query_settings

Required Imports

from office365.sharepoint.entity import Entity
from office365.sharepoint.ui.applicationpages.peoplepicker.query_settings import PeoplePickerQuerySettings

Usage Example

from office365.sharepoint.ui.applicationpages.peoplepicker.settings import PickerSettings
from office365.sharepoint.client_context import ClientContext

# Assuming you have a SharePoint context
ctx = ClientContext(site_url).with_credentials(credentials)

# Retrieve picker settings (typically from SharePoint API)
picker_settings = ctx.web.get_property('PickerSettings')
ctx.execute_query()

# Access configuration properties
if picker_settings.allow_email_addresses:
    print('Email addresses are allowed')

if picker_settings.allow_only_email_addresses:
    print('Only email addresses are allowed')

# Access query settings
query_settings = picker_settings.query_settings
print(f'Query settings: {query_settings}')

Best Practices

  • This class is read-only and provides property-based access to configuration data; do not attempt to directly modify properties
  • The class is typically instantiated by SharePoint API responses rather than manually constructed
  • Properties may return None if the corresponding setting is not configured in SharePoint
  • The query_settings property returns a default PeoplePickerQuerySettings instance if not present in properties
  • This class follows the Entity pattern and relies on the parent class's properties dictionary for data storage
  • Use this class in conjunction with SharePoint ClientContext to retrieve actual picker configuration from the server

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SharePointSharingSettings 83.7% 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 PeoplePickerQuerySettings 81.6% similar

    A data class representing additional settings for SharePoint principal queries, specifically for people picker operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/query_settings.py
  • class PickerEntityInformation 68.3% similar

    A class representing additional information about a principal (user, group, or security entity) in SharePoint's people picker system.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/entity_information.py
  • class ClientPeoplePickerWebServiceInterface 66.7% similar

    A SharePoint web service interface class that provides static methods for querying and resolving principals (users, groups) using the People Picker functionality.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/ui/applicationpages/peoplepicker/web_service_interface.py
  • class FilePickerOptions 66.6% similar

    A configuration class for SharePoint file picker options that extends ClientValue to specify search settings and organizational asset repositories.

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