New command: 🔐 spo roledefinition add
Usage
m365 spo roledefinition add [options]
Description
Should add a new roledefinition to web
Options
| Option | Description |
|---|---|
-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 |
Additional Info
I was thinking that now since we added first command to list the role definitions from web we need other as well (get, add and delete) 🤔.
In this issue I would like to consider adding a add command to create new role definition.
We may use this POST request for this
/_api/Web/RoleDefinitions
specifying this JSON in the body if the request
{
"BasePermissions":{ // 👉TBH I am still not sure why do we need this node.. need to investigate this a bit ;)
"High":"176",
"Low":"138612801"
},
"Description":"${description}",
"Name":"${name}"
}
the expected result should be a new role definition added

Great suggestion. BasePermissions describe the permissions associated with the role definition. It's a bit-flag composed out of the different permissions, so when creating a new definition, we'd need to find a way for users to specify the permissions the role should contain and then translate them to a flag.
as for the flags concept we may put this issue on hold and when those will be added together with #3270 we may got back to this one. What do you think?
Makes sense to avoid duplicate work. Let's do that
waiting for #3359 to be finished and merged and then I may start working on this