SPPermission class

Used to test whether the current user has a requested set of permissions.

Remarks

Specifies the built-in permissions available in SharePoint Foundation

For more information, see: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx

Constructors

(constructor)(value)

Constructs a new instance of the SPPermission class

Properties

addAndCustomizePages

Add, change, or delete HTML pages or web part Pages, and edit the Web site using a SharePoint Foundation-compatible editor.

addDelPrivateWebParts

Add or remove personal web parts on a web part Page.

addListItems

Add items to lists, add documents to document libraries, and add Web discussion comments.

applyStyleSheets

Apply a style sheet (.css file) to the Web site.

applyThemeAndBorder

Apply a theme or borders to the entire Web site.

approveItems

Approve a minor version of a list item or document.

browseDirectories

Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.

browserUserInfo

View information about users of the Web site.

cancelCheckout

Discard or check in a document which is checked out to another user.

createAlerts

Create e-mail alerts.

createGroups

Create a group of users that can be used anywhere within the site collection.

createSSCSite

Create a Web site using Self-Service Site Creation.

deleteListItems

Delete items from a list, documents from a document library, and Web discussion comments in documents.

deleteVersions

Delete past versions of a list item or document.

editListItems

Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize web part Pages in document libraries.

editMyUserInfo

Allows a user to change his or her user information, such as adding a picture.

emptyMask

Has no permissions on the Web site. Not available through the user interface.

enumeratePermissions

Enumerate permissions on the Web site, list, folder, document, or list item.

fullMask

Has all permissions on the Web site. Not available through the user interface.

layoutsPage

View the layouts page?

manageAlerts

Manage alerts for all users of the Web site.

manageLists

Create and delete lists, add or remove columns in a list, and add or remove public views of a list.

managePermissions

Create and change permission levels on the Web site and assign permissions to users and groups.

managePersonalViews

Create, change, and delete personal views of lists.

manageSubwebs

Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.

manageWeb

Grant the ability to perform all administration tasks for the Web site as well as manage content.

open

Allow users to open a Web site, list, or folder to access items inside that container.

openItems

View the source of documents with server-side file handlers.

updatePersonalWebParts

Update web parts to display personalized information.

useClientIntegration

Use features that launch client applications; otherwise, users must work on documents locally and upload changes.

useRemoteAPIs

Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.

value

Returns the value of this SPPermission object

viewFormPages

View forms, views, and application pages, and enumerate lists.

viewListItems

View items in lists, documents in document libraries, and view Web discussion comments.

viewPages

View pages in a Web site.

viewUsageData

View reports on Web site usage.

viewVersions

View past versions of a list item or document.

Methods

hasAllPermissions(requestedPerms)

Function for testing whether a given permission mask has all of the requested permissions.

hasAnyPermissions(requestedPerms)

Function for testing whether a given permission mask has any of the requested permissions.

hasPermission(requestedPerm)

Function for testing whether a given permission mask has the requested permission.

Constructor Details

(constructor)(value)

Constructs a new instance of the SPPermission class

constructor(value: IODataBasePermission);

Parameters

Property Details

addAndCustomizePages

Add, change, or delete HTML pages or web part Pages, and edit the Web site using a SharePoint Foundation-compatible editor.

static readonly addAndCustomizePages: SPPermission;

Property Value

addDelPrivateWebParts

Add or remove personal web parts on a web part Page.

static readonly addDelPrivateWebParts: SPPermission;

Property Value

addListItems

Add items to lists, add documents to document libraries, and add Web discussion comments.

static readonly addListItems: SPPermission;

Property Value

applyStyleSheets

Apply a style sheet (.css file) to the Web site.

static readonly applyStyleSheets: SPPermission;

Property Value

applyThemeAndBorder

Apply a theme or borders to the entire Web site.

static readonly applyThemeAndBorder: SPPermission;

Property Value

approveItems

Approve a minor version of a list item or document.

static readonly approveItems: SPPermission;

Property Value

browseDirectories

Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.

static readonly browseDirectories: SPPermission;

Property Value

browserUserInfo

View information about users of the Web site.

static readonly browserUserInfo: SPPermission;

Property Value

cancelCheckout

Discard or check in a document which is checked out to another user.

static readonly cancelCheckout: SPPermission;

Property Value

createAlerts

Create e-mail alerts.

static readonly createAlerts: SPPermission;

Property Value

createGroups

Create a group of users that can be used anywhere within the site collection.

static readonly createGroups: SPPermission;

Property Value

createSSCSite

Create a Web site using Self-Service Site Creation.

static readonly createSSCSite: SPPermission;

Property Value

deleteListItems

Delete items from a list, documents from a document library, and Web discussion comments in documents.

static readonly deleteListItems: SPPermission;

Property Value

deleteVersions

Delete past versions of a list item or document.

static readonly deleteVersions: SPPermission;

Property Value

editListItems

Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize web part Pages in document libraries.

static readonly editListItems: SPPermission;

Property Value

editMyUserInfo

Allows a user to change his or her user information, such as adding a picture.

static readonly editMyUserInfo: SPPermission;

Property Value

emptyMask

Has no permissions on the Web site. Not available through the user interface.

static readonly emptyMask: SPPermission;

Property Value

enumeratePermissions

Enumerate permissions on the Web site, list, folder, document, or list item.

static readonly enumeratePermissions: SPPermission;

Property Value

fullMask

Has all permissions on the Web site. Not available through the user interface.

static readonly fullMask: SPPermission;

Property Value

layoutsPage

View the layouts page?

static readonly layoutsPage: SPPermission;

Property Value

manageAlerts

Manage alerts for all users of the Web site.

static readonly manageAlerts: SPPermission;

Property Value

manageLists

Create and delete lists, add or remove columns in a list, and add or remove public views of a list.

static readonly manageLists: SPPermission;

Property Value

managePermissions

Create and change permission levels on the Web site and assign permissions to users and groups.

static readonly managePermissions: SPPermission;

Property Value

managePersonalViews

Create, change, and delete personal views of lists.

static readonly managePersonalViews: SPPermission;

Property Value

manageSubwebs

Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.

static readonly manageSubwebs: SPPermission;

Property Value

manageWeb

Grant the ability to perform all administration tasks for the Web site as well as manage content.

static readonly manageWeb: SPPermission;

Property Value

Remarks

Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.

open

Allow users to open a Web site, list, or folder to access items inside that container.

static readonly open: SPPermission;

Property Value

openItems

View the source of documents with server-side file handlers.

static readonly openItems: SPPermission;

Property Value

updatePersonalWebParts

Update web parts to display personalized information.

static readonly updatePersonalWebParts: SPPermission;

Property Value

useClientIntegration

Use features that launch client applications; otherwise, users must work on documents locally and upload changes.

static readonly useClientIntegration: SPPermission;

Property Value

useRemoteAPIs

Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.

static readonly useRemoteAPIs: SPPermission;

Property Value

value

Returns the value of this SPPermission object

get value(): IODataBasePermission;

Property Value

viewFormPages

View forms, views, and application pages, and enumerate lists.

static readonly viewFormPages: SPPermission;

Property Value

viewListItems

View items in lists, documents in document libraries, and view Web discussion comments.

static readonly viewListItems: SPPermission;

Property Value

viewPages

View pages in a Web site.

static readonly viewPages: SPPermission;

Property Value

viewUsageData

View reports on Web site usage.

static readonly viewUsageData: SPPermission;

Property Value

viewVersions

View past versions of a list item or document.

static readonly viewVersions: SPPermission;

Property Value

Method Details

hasAllPermissions(requestedPerms)

Function for testing whether a given permission mask has all of the requested permissions.

hasAllPermissions(...requestedPerms: SPPermission[]): boolean;

Parameters

requestedPerms

SPPermission[]

Any number of SPPermission objects to be compared against the original

Returns

boolean

hasAnyPermissions(requestedPerms)

Function for testing whether a given permission mask has any of the requested permissions.

hasAnyPermissions(...requestedPerms: SPPermission[]): boolean;

Parameters

requestedPerms

SPPermission[]

Any number of SPPermission objects to be compared against the original

Returns

boolean

hasPermission(requestedPerm)

Function for testing whether a given permission mask has the requested permission.

hasPermission(requestedPerm: SPPermission): boolean;

Parameters

requestedPerm
SPPermission

The SPPermission object to be compared against the original

Returns

boolean