Hi @cardinaluk ,
Please take a reference of below code:
const ReadroleDefinition = await sp.web.roleDefinitions.getByName("Read").get();
console.log("roleDefinition : ", ReadroleDefinition);
await sp.web.lists.getByTitle('mmm').items.getById(1).breakRoleInheritance(true);
await sp.web.lists.getByTitle('mmm').items.getById(1).roleAssignments.add(user.Id, ReadroleDefinition.Id);
More reference:
- https://pnp.github.io/pnpjs/sp/security/#role-assignments
- http://www.benprins.net/2019/06/27/flow-set-permissions-using-rest-api-without-app-permissions/
Best Regards,
Baker Kong
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.