Assigning the customized site permission levels to users or groups



We are trying to integrate Microsoft 365 into our services. We did implement the APIs provided by Microsoft Graph.
So now we are trying to automate few operations. We implemented API to assign Folder level permissions(Default ones - Read, Write, Owner, or full control) to users or groups. We also want to that an API should be able to assign the customized permission levels to be assigned/created/revoked. We did try some ways which are available in a few documents and Github. We are not able to achieve it.

So we need your assistance in this process and help us.

  1. Goal - To implement API to assign/create/revoke customized site permission levels to users/groups? By using REST API in Asp .Net core using c#.
  2. Is there any APIs available to achieve the above goal?
  3. Is there any NuGets available to achieve the above goal? (Like Sharpoint, Sharepoint. Client, etc)
  4. If API or NuGet is available what type of authentication we need to get the client? Do we need a user token or app token?
  5. Can we achieve the above goal in any other way?

Few details about the services or product we are using in our project.

  • We have Microsoft 365 Enterprise plan(E5).
  • We are Sharepoint 2019.
  • Using Asp .Net core with C#.
  • Using Azure services too to manage Sharepoint and its groups.

Please do help us to find a solution by answering the above questions and assisting us.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
8,564 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 17,996 Reputation points

    Hi anonymous user

    I would suggest you use CSOM in the .Net Core to assign/create/revoke customized site permission levels to users/groups. You could refer to this official documentation:

    You have to use modern authentication with CSOM in .Net Core. To get access token, the recommended approach for getting access tokens for SharePoint Online is by setting up an Azure AD application

    Besides, you could use PnP Core SDK in your solution which is more convinent for you. Below article would help you:

    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.

    0 comments No comments