Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

ckeck if special user has access to a document in SPO

(0) ShareShare
ReportReport
Posted on by 4

hi to all,
i have a flow triggered from a powerapp and a user email address comes from the app.

In the flow i try to check if the user (from email address) has access to a special document in a document library.

If not the flow should not give back the content of the document.

 

How can i do the access check?

 

regards

 

  • iw Profile Picture
    4 on at
    Re: ckeck if special user has access to a document in SPO

    thank you for your Feedback.

     

    is this the right way?

     

    _api/web/GetFileByServerRelativeUrl('/Folder Name/file name')/$value/getusereffectivepermissions(@user)?@user='loggedInUser'

  • RezaDorrani Profile Picture
    12,141 on at
    Re: ckeck if special user has access to a document in SPO

    Hi @iw 

     

    Since your PowerApp is calling Flow it will do so in the context of the current logged in user

     

    If you try and query that special document library item for the current user it will either return no results or exception

     

    For no results you can check the length of the result set, if 0 then user does not have access

    If exception for file not found =, you can configure run after step and return empty content

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Verified answer
    abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: ckeck if special user has access to a document in SPO

    Hi @iw 

     

    Use the REST API method HTTP Get method getusereffectivepermissions(@user)?@user='<user login name>' to determine user permissions.

     

    https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/dn531433%28v%3doffice.15%29

     

    Look section GetUserEffectivePermissions method

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1