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



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


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



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Power Virtual Agents News & Announcements

Power Virtual Agents News & Announcements

Keep up to date with current events and community announcements in the Power Virtual Agents community.

Power Virtual Agents Community Blog

Power Virtual Agents Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,825)