Skip to main content

spo roledefinition add

Adds a new roledefinition to web


m365 spo roledefinition add [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 options.

--query [query]

JMESPath query string. See for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.


Runs command with verbose logging.


Runs command with debug logging.


The --rights option accepts case-sensitive values.


Adds the role definition for the given site

m365 spo roledefinition add --webUrl --name test

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

m365 spo roledefinition add --webUrl --name test --description "test description" --rights "ViewListItems,AddListItems,EditListItems,DeleteListItems"


The command won't return a response on success.