cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Luigi_cff
Frequent Visitor

Set access permissioning and display a message for the user

I am trying to create a flow via power automate

to redirect the user to an specific page but if the

 

user doesn't have permissioning for accessing that page,

the flow should run and display the message for the user

 

in my bot saying that he/she don't have

access permissioning for that page. 

 

Thank you for your attention.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Luigi_cff,

 

What type of page is this. Is this by any chance a SharePoint page?

 

If so, you could use the SharePoint REST API to check the user permissions for the using talking to the bot with the GetUserEffectivePermissions method:

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn5314...

 

Below is an example of that approach.

 

1. The Cloud flow. It uses the User Id to retrieve the Mail which is used in the Send an HTTP request to SharePoint action.

 

This expression is used to check if the user has or hasn't got access. Based on the outcome either a message or a link is sent back.

if(equals(body('Send_an_HTTP_request_to_SharePoint')['high'],'0'), 'You do not have access to this page', variables('Hyperlink'))

 

getusereffectivepermissions_cloudflow.png

 

2. An example topic which uses this cloud flow.

 

getusereffectivepermissions_topic.png

View solution in original post

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @Luigi_cff,

 

What type of page is this. Is this by any chance a SharePoint page?

 

If so, you could use the SharePoint REST API to check the user permissions for the using talking to the bot with the GetUserEffectivePermissions method:

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn5314...

 

Below is an example of that approach.

 

1. The Cloud flow. It uses the User Id to retrieve the Mail which is used in the Send an HTTP request to SharePoint action.

 

This expression is used to check if the user has or hasn't got access. Based on the outcome either a message or a link is sent back.

if(equals(body('Send_an_HTTP_request_to_SharePoint')['high'],'0'), 'You do not have access to this page', variables('Hyperlink'))

 

getusereffectivepermissions_cloudflow.png

 

2. An example topic which uses this cloud flow.

 

getusereffectivepermissions_topic.png

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

Canadian Cloud 2022 768x460.png

Register for a free PVA chatbot creation workshop.

Learn how to respond rapidly to your customers and employees at scale, using intelligent conversational chatbots.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,295)