Skip to content

New command: 🔐 spo listitem roleassignment add #3539

@martinlingstuyl

Description

@martinlingstuyl

Usage

m365 spo listitem roleassignment add [options]

Description

adds a role assignment to a listitem.

Options

Option Description
-u, --webUrl <webUrl> URL of the site where the list is located
--listId [listId] ID of the list. Specify either listId, listTitle or listUrl.
--listTitle [listTitle] Title of the list. Specify either listId, listTitle or listUrl.
--listUrl [listUrl] Relative URL of the list. Specify either listId, listTitle or listUrl.
--listItemId <listItemId> Id of the listitem to assign the role to.
--principalId [principalId] The SharePoint Id of the principal. It may be either a user id or group id to add a role assignment for. Specify either upn, groupName or principalId.
--upn [upn] upn/email of user to assign role to. Specify either upn, groupName or principalId.
--groupName [groupName] The group name of Azure AD or SharePoint group. Specify either upn, groupName or principalId.
--roleDefinitionId [roleDefinitionId] ID of role definition. Specify either roleDefinitionId or roleDefinitionName but not both
--roleDefinitionName [roleDefinitionName] The name of a role definition, like 'Contribute', 'Read', etc. Specify either roleDefinitionId or roleDefinitionName but not both

we may use this POST endpoint
/_api/web/lists/getbytitle("SomeList")/items("SomeId")/roleassignments/addroleassignment(principalid='{SomeGroupOrUserIDHere}',roledefid='{SomeRoleIdHere}')

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions