Skip to content

spo roledefinition add

Adds a new roledefinition to web

Usage

m365 spo roledefinition add [options]

Options

-u, --webUrl <webUrl>
URL of the site to which role should be added
-n, --name <name>
role definition name
-d, --description [description]
role definition description
--rights [rights]
A case-sensitive string array that contain the permissions needed for the custom action. Allowed values EmptyMask,ViewListItems,AddListItems,EditListItems,DeleteListItems,ApproveItems,OpenItems,ViewVersions,DeleteVersions,CancelCheckout,ManagePersonalViews,ManageLists,ViewFormPages,AnonymousSearchAccessList,Open,ViewPages,AddAndCustomizePages,ApplyThemeAndBorder,ApplyStyleSheets,ViewUsageData,CreateSSCSite,ManageSubwebs,CreateGroups,ManagePermissions,BrowseDirectories,BrowseUserInfo,AddDelPrivateWebParts,UpdatePersonalWebParts,ManageWeb,AnonymousSearchAccessWebLists,UseClientIntegration,UseRemoteAPIs,ManageAlerts,CreateAlerts,EditMyUserInfo,EnumeratePermissions,FullMask. Default EmptyMask
-h, --help
output usage information
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text,csv. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Remarks

The --rights option accepts case-sensitive values.

Examples

Adds the role definition for site https://contoso.sharepoint.com/sites/project-x with name test

m365 spo roledefinition add --webUrl https://contoso.sharepoint.com/sites/project-x --name test

Adds the role definition for site https://contoso.sharepoint.com/sites/project-x with name test and description test description and rights ViewListItems,AddListItems,EditListItems,DeleteListItems

m365 spo roledefinition add --webUrl https://contoso.sharepoint.com/sites/project-x --name test --description "test description" --rights "ViewListItems,AddListItems,EditListItems,DeleteListItems"