web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Best practices for RBA...
Power Apps
Suggested Answer

Best practices for RBAC and BPF-driven approvals in Dataverse

(1) ShareShare
ReportReport
Posted on by 2

Hi guys,

I have a few ideas in my head and I need some help figuring out best practices for simple Role-Based Access Control (RBAC) combined with a Business Process Flow, while keeping everything as out-of-the-box as possible.

 

SCENARIO

We’re building a pet rental program.

Rentals are stored in the Rental table, and the rental lifecycle is supported by a Business Process Flow – Rental BPF, which includes the following stages:

 
  • Submission – basic rental data is provided

  • Approval – we identify the current pet owner’s manager and send them an approval task (my idea is to use a built-in Approval via a Cloud Flow)

QUESTIONS

  1. After the Submission stage, I want to make sure that only the manager can continue the process in the BPF.

    When creating the approval task, I would also like to restrict access to the Rental row.

    What would be the recommended / best-practice way to achieve this?

  2. What is the preferred way to trigger the approval flow?

    • Trigger it directly from the BPF using an Action step, or

    • Use an Automated Cloud Flow with a When a row is modified trigger?

  3. When using an Automated Cloud Flow with a Modified trigger, it’s difficult to reliably determine which BPF stage the record is currently in.

    It’s possible by querying the Process Stage table, but that would need to run on every modification and doesn’t feel very optimized
    Hard-coding stage GUIDs also doesn’t seem like a good idea, since stage IDs may change between environments.

    Am I correct in these concerns, or is there a recommended pattern to handle this cleanly

    Thanks in advance for any guidance or real-world experience you can share 





  4.  
I have the same question (0)
  • Suggested answer
    VASANTH KUMAR BALMADI Profile Picture
    281 on at

    You’re thinking about this exactly the right way — and your concerns are valid.
    What you’re trying to build is a very common Dataverse pattern, and Microsoft already has a fairly established “best-practice” way to do it without custom code and without fighting the platform.

    Below is the clean, supportable, mostly out-of-the-box architecture that scales well and avoids fragile stage GUID logic.

    ✅ Core principle (very important)

    Business Process Flow ≠ security boundary

    A BPF is only:

    • a UI guidance tool

    • a stage indicator

    It does not control who can edit a row or move stages.

    So the correct pattern is:

    Security is enforced by Dataverse row ownership and access teams — not by the BPF itself.

    The BPF simply reflects that state.

    ✅ Recommended architecture (Microsoft pattern)

    ✔ Dataverse security controls access

    ✔ BPF reflects lifecycle

    ✔ Power Automate performs orchestration

    ✔ No hard-coded stage IDs

    ✔ No plugins required

    ✅ Final recommended design

    1️⃣ Use Owner-based security on Rental

    Set the Rental table to:

    Ownership = User or Team
    

    This is required.

    2️⃣ Use an Access Team per Rental

    This is the key piece most people miss.

    Create an Access Team Template for Rental:

    Example roles:

    • Rental Submitter → Read

    • Rental Manager → Read + Write + Append + Append To

    Access teams allow you to:

    • dynamically grant access per record

    • avoid changing ownership

    • avoid complex security roles

    3️⃣ Submission stage logic

    When the user submits the rental:

    Cloud Flow (or BPF action) does:

    1. Identify the pet owner’s manager

    2. Create (or reuse) the Rental Access Team

    3. Add:

      • submitter → read-only

      • manager → contributor

    4. Optionally remove broader access

    At this point:

    ✅ User can still see the record
    ❌ User can no longer edit it
    ✅ Manager now has edit rights

    No BPF trickery required.

    4️⃣ Approval stage access control

    Now only the manager can:

    • edit the record

    • advance the BPF stage

    • complete approval fields

    Because only they have write access.

    Even if someone clicks the stage:

    Dataverse will block it automatically.

    5️⃣ Trigger approval flow (best practice)

    Do NOT trigger from “When row modified”

    You are absolutely correct — this causes:

    • performance issues

    • unreliable stage detection

    • unnecessary ProcessStage queries

    • environment-specific GUID problems

    ✅ Preferred trigger: BPF Action Step

    Inside the Business Process Flow:

    Add an Action Step:

    Start Approval
    

    This action:

    • calls a Cloud Flow

    • passes Rental ID

    • runs exactly once

    • is environment safe

    • requires no stage lookup logic

    This is the recommended approach.

    Why Action Step is better

    Reason Benefit
    Explicit trigger No false positives
    Runs once No re-trigger issues
    No GUIDs Fully solution-aware
    No ProcessStage query Better performance
    Clear audit trail Easy support
    Designed for BPF Microsoft-intended use

    6️⃣ Approval flow logic

    The approval flow:

    1. Receives Rental ID

    2. Reads manager from lookup

    3. Sends approval (Approvals connector)

    4. On approve:

      • updates Rental status

      • optionally moves BPF forward

    5. On reject:

      • unlocks record

      • reassigns access back to submitter

    7️⃣ Scheduled execution requirement

    Because everything is server-side:

    You can also trigger the same approval logic from:

    • Scheduled flow

    • Manual admin flow

    • Button

    • API call

    No dependency on UI.

    ✅ What you should NOT do

    ❌ Hard-code BPF stage GUIDs
    ❌ Query ProcessStage on every update
    ❌ Use BPF as a security mechanism
    ❌ Change record ownership repeatedly
    ❌ Trigger approvals on generic modified events

    Your instincts here are 100% correct.

    ✅ Final recommended stack

    Dataverse Security
       ├─ Owner-based table
       ├─ Access Teams (per Rental)
       ↓
    Business Process Flow
       ├─ Guides user
       ├─ Shows current stage
       ├─ Triggers actions
       ↓
    Cloud Flow
       ├─ Approval
       ├─ Access updates
       ├─ Status transitions
    

    ✅ Summary answers to your questions

    ✔ How to restrict BPF progression?

    By restricting row write access, not by the BPF itself.

    ✔ How to restrict access after submission?

    Use Access Teams, not ownership changes.

    ✔ How to trigger approval?

    BPF Action Step (best practice)

    ✔ Is querying ProcessStage bad?

    Yes — avoid it.

    ✔ Are stage GUIDs unsafe?

    Yes — they change across environments.

    ✔ Is your concern valid?

    Completely. You’re thinking at enterprise-architecture level.

    🧠 This is the same pattern Microsoft uses internally for:

    • Opportunity approvals

    • Case resolution workflows

    • Contract lifecycle

    • D365 Sales approval flows

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard