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 [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text,csv,md. 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 the given site

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

Adds the role definition for the given site with description and rights

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

Response

The command won't return a response on success.