cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

New command: 🔐 spo roledefinition add

Open Adam-it opened this issue 3 years ago • 4 comments

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 image

Adam-it avatar May 01 '22 12:05 Adam-it

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.

waldekmastykarz avatar May 01 '22 17:05 waldekmastykarz

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?

Adam-it avatar May 05 '22 20:05 Adam-it

Makes sense to avoid duplicate work. Let's do that

waldekmastykarz avatar May 09 '22 17:05 waldekmastykarz

waiting for #3359 to be finished and merged and then I may start working on this

Adam-it avatar Jun 04 '22 11:06 Adam-it