Pega Security – Part 5: Restrict a Flow Action to Specific Users Using Privileges, Access Roles & ARO

Restrict a Pega Flow Action to Specific Users Using Privilege, Access Role and ARO

In Pega, there are many situations where a Flow Action should not be available to every user working on the same assignment.

For example, imagine an Alpha Bank Loan Application. Both a Credit Manager and a Credit Analyst may work on the same Credit Review assignment.

However, the bank may have a simple business requirement:

Only authorized Credit Managers should see and perform the "Approve Loan" Flow Action.

Credit Analysts can work on the same assignment, but they should not even see the Approve Loan action.

This is where Pega's Privilege, Access Role, Access Role to Object (ARO), and Access When security model becomes useful.

In this article, we will build this scenario from the rule level and follow it all the way through runtime.

Restrict a Pega Flow Action to specific users using Privilege Access Role ARO and Access When

Pega Flow Action Security: Restrict a specific Flow Action to authorized users using Privilege, Access Role, ARO, and optional Access When.

1. Alpha Bank Business Scenario

Let's use a simple Alpha Bank Loan Application to understand the requirement.

Alpha Bank has a Loan Application case. After the loan reaches the credit review stage, users are assigned to a Credit Review assignment.

The assignment has several Flow Actions:

Approve Loan
Reject Loan
Request Information

Now consider these two users:

Sarah – Credit Manager

Sarah is authorized to approve or reject loans.

Bob – Credit Analyst

Bob can review the loan and request additional information, but he should not be allowed to approve the loan.

Both Sarah and Bob may open the same Loan Application and reach the same Credit Review assignment.

The requirement is not necessarily to restrict the entire case. We want to restrict one particular action:

Credit Manager → Approve Loan is available
but
Credit Analyst → Approve Loan is not available

2. First Understand What We Are Securing

Before creating any security rule, identify exactly what needs to be protected.

In this example, we are not simply hiding a button.

We are securing the Flow Action itself.

UI Visibility

Controls what the user sees in the interface.

Useful for user experience, but it should not be the only security mechanism.

Flow Action Security

Uses Pega's security model to determine whether the user is authorized to access the Flow Action.

This is the security boundary we are implementing.

Do not confuse "hide the button" with "secure the action."

3. The Security Architecture

The basic security relationship for our Alpha Bank example is:

User
Sarah
Access Group
AlphaBank-CreditManagers
Access Role
AlphaBank:CreditManager
ARO
Role → Object
Privilege
ApproveLoan
Flow Action
Approve Loan

If conditional authorization is required, an Access When condition can also participate in the authorization decision.

4. Step 1 – Create a Privilege

The first rule we create is the Privilege.

A privilege represents a specific protected capability or action. In our example, we want to protect the ability to approve a loan.

Where do we create it?

Dev Studio

Create

Security

Privilege

Example Privilege

Field Example
Label Approve Loan
Name ApproveLoan
Applies To AlphaBank-Work-LoanApplication
Ruleset AlphaBank
Important: The privilege itself does not automatically mean Sarah has the privilege. We still need to grant that privilege through the authorization model.

5. Step 2 – Secure the Flow Action with the Privilege

Now we have a privilege called ApproveLoan.

The next step is to associate that privilege with the Flow Action that should be protected.

In our case:

Flow Action: Approve Loan
Applies To: AlphaBank-Work-LoanApplication
Required Privilege: ApproveLoan

Configure the Flow Action

Open the Approve Loan Flow Action and go to its Security configuration.

Flow Action: Approve Loan

Security

Required Privilege

ApproveLoan

This tells Pega that access to this Flow Action requires the ApproveLoan privilege.

The security relationship is now:

Approve Loan Flow Action requires ApproveLoan Privilege.

6. Step 3 – Grant the Privilege to an Access Role Through an ARO

We now have a protected Flow Action and a privilege.

But Pega still needs to know:

Which role is allowed to use the ApproveLoan privilege?

This is where the Access Role and Access Role to Object (ARO) come into play.

Example Access Role

Access Role: AlphaBank:CreditManager

We then configure the Access Role to Object relationship for the Loan Application class.

Example ARO

ARO Setting Alpha Bank Example
Access Role AlphaBank:CreditManager
Applies To Class AlphaBank-Work-LoanApplication
Privilege ApproveLoan

The important relationship is:

AlphaBank:CreditManager

ARO

ApproveLoan Privilege

AlphaBank-Work-LoanApplication

Now the Credit Manager role has been granted the privilege for the relevant application class.

7. Step 4 – Use Access When for Conditional Authorization

The privilege can be enough when every Credit Manager should always be allowed to approve every loan they can access.

But real banking applications often have additional business rules.

For example:

  • A manager can approve loans only for their region.
  • A manager can approve loans only below a certain amount.
  • A user can approve only applications assigned to their branch.
  • A user can approve only during a particular business condition.

In these situations, an Access When rule can add conditional authorization to the role/object relationship.

Example

Suppose Sarah is a Northeast Credit Manager.

We want the Approve Loan action to be available only when the loan belongs to Sarah's authorized region.

@CurrentUser.pyWorkGroup == .LoanRegion

The exact expression and properties depend on the application's data model. The important concept is that the Access When rule returns a Boolean security decision.

TRUE

Conditional requirement is satisfied.

FALSE

Conditional requirement is not satisfied.

Therefore, the authorization can conceptually become:

User has RoleRole has PrivilegeAccess When is TRUEFlow Action is authorized

8. Step 5 – Associate Users with the Appropriate Access Group and Role

We have now configured the privilege and granted it to the AlphaBank:CreditManager role.

But how does Sarah actually receive that role?

This comes through her Pega security context, including her Access Group and its associated roles.

Example – Credit Managers

Access Group: AlphaBank-CreditManagers

Application: AlphaBank

Roles:
  • AlphaBank:CreditManager
  • AlphaBank:SeniorCreditManager

Sarah's Operator configuration provides her with the appropriate Access Group.

As a result, Sarah's active security context includes the Credit Manager role, which has the ARO granting the ApproveLoan privilege.

9. End-to-End Rule Relationship

At this point, all the pieces are connected.

Sarah – Operator
AlphaBank-CreditManagers
AlphaBank:CreditManager
ARO
ApproveLoan Privilege
Approve Loan Flow Action
Sarah can see and perform Approve Loan

10. Runtime Example – Same Assignment, Different Users

This is where the security design becomes easy to understand.

Assume the same Loan Application is assigned to a Credit Review assignment.

Both Sarah and Bob can reach the same screen.

However, Pega evaluates their security context independently.

Sarah – Credit Manager

Sarah has:

  • AlphaBank-CreditManagers Access Group
  • AlphaBank:CreditManager role
  • ARO for Loan Application
  • ApproveLoan privilege
  • Required Access When condition, if configured
Approve Loan is available

Bob – Credit Analyst

Bob may have:

  • AlphaBank-CreditAnalysts Access Group
  • AlphaBank:CreditAnalyst role
  • Access to the Loan Application
  • No ApproveLoan privilege
Approve Loan is not available

11. What Does the User Actually See?

Imagine both users are looking at Loan Application APP-1001.

Sarah – Authorized User

Credit Review

✓ Approve Loan Reject Request Information

Bob – Unauthorized User

Credit Review

Reject Request Information

Approve Loan is not available because Bob does not have the required privilege.

12. Why We Should Not Just Use a UI Visibility Condition

A common implementation mistake is to solve this requirement only by hiding the Approve Loan button using a UI condition.

For example, a developer might create logic such as:

Show Approve Loan only when User.Role = CreditManager

This may improve the user experience, but it should not be considered the complete security implementation.

UI visibility answers:
"Should I display this control?"

Authorization answers:
"Is this user actually allowed to perform this action?"

Therefore, for a security-sensitive Flow Action, use Pega's authorization model rather than relying only on UI visibility logic.

13. Why Use a Privilege Instead of Giving Everyone the Same Role?

A role can represent a broad business responsibility.

For example:

  • Credit Analyst
  • Credit Manager
  • Senior Credit Manager
  • Branch Manager

But within a role, different protected actions may exist.

For example:

Flow Action Example Privilege
Approve Loan ApproveLoan
Reject Loan RejectLoan
Request Information RequestLoanInformation

This allows the security model to express more precise authorization requirements.

14. What If Both Credit Manager and Senior Credit Manager Can Approve?

We do not need to create another Flow Action just because another role needs the same capability.

We can grant the same privilege to multiple appropriate roles.

AlphaBank:CreditManager

ApproveLoan privilege

AlphaBank:SeniorCreditManager

ApproveLoan privilege

Therefore, Sarah and another Senior Credit Manager can both see the Approve Loan action, while users without the privilege cannot.

15. What If I Need to Restrict It to One Specific User?

Sometimes the requirement sounds like:

"Only Sarah should be able to approve this."

The cleaner Pega security design is generally not to hard-code Sarah's Operator ID directly into the Flow Action security rule.

Instead, model the business authorization using a role.

Sarah AlphaBank-CreditManagers CreditManager Role ApproveLoan Privilege

If the business requirement really is user-specific, the user's membership in the appropriate security context can be managed through the Operator and Access Group configuration rather than embedding individual user identities inside application logic.

This keeps the Flow Action security reusable and easier to maintain.

16. More Realistic Alpha Bank Example – Approval by Region

Let's make the example a little more realistic.

Alpha Bank has regional Credit Managers.

Sarah belongs to the Northeast region.

The Loan Application contains:

LoanRegion: Northeast

Sarah's security context contains the appropriate region information.

We can use an Access When condition so that the ApproveLoan authorization applies only when the relevant regional condition is satisfied.

User Region = Loan Region

Now we have two layers:

Role / Privilege

Is this user generally authorized to approve loans?

Access When

Does this particular business condition allow the authorization?

17. Rule-Level Configuration Summary

Here is the complete configuration from a Pega developer's perspective.

Step Pega Configuration Alpha Bank Example
1 Create Privilege ApproveLoan
2 Add privilege to Flow Action Security Approve Loan → ApproveLoan
3 Grant privilege through ARO CreditManager → LoanApplication → ApproveLoan
4 Optional Access When User region = Loan region
5 Associate user with security context Sarah → Credit Managers Access Group
Pega Flow Action security workflow showing user Access Group Access Role ARO Privilege and Flow Action

Runtime security flow: Pega evaluates the user's security context and required privilege before making the protected Flow Action available.

18. Troubleshooting – Approve Loan Is Not Visible

Suppose Sarah says:

"I am a Credit Manager, but I cannot see Approve Loan."

Do not immediately modify the Flow Action.

Trace the security chain from the user downward.

1. Operator2. Access Group3. Access Role4. ARO5. Privilege6. Flow Action Security7. Access When

Check 1 – Is Sarah using the expected Operator?

Confirm that the authenticated user is the expected Pega Operator.

Check 2 – Is the correct Access Group active?

Confirm that Sarah is operating under the expected AlphaBank-CreditManagers Access Group.

Check 3 – Does the Access Group provide the expected role?

Confirm that the Credit Manager role is actually associated with the security context Sarah is using.

Check 4 – Does the ARO grant the privilege?

Confirm that the Access Role to Object relationship applies to the correct class and includes ApproveLoan.

Check 5 – Does the Flow Action require the same privilege?

Open the Flow Action Security configuration and verify that the required privilege is ApproveLoan.

Check 6 – Is Access When returning the expected result?

If an Access When rule is configured, validate the data used by that condition and confirm that the condition evaluates as expected.

19. Common Mistakes

Mistake 1 – Only hiding the button

UI visibility is not the complete authorization mechanism.

Mistake 2 – Hard-coding Operator IDs

Avoid embedding individual users into application logic when the business requirement can be modeled through reusable roles.

Mistake 3 – Forgetting the ARO

Creating a privilege does not automatically grant that privilege to a user.

Mistake 4 – Ignoring Access When

If conditional authorization is configured, verify the condition and the data used by the condition.

20. Flow Routing and Flow Action Security Are Different

Another important design concept is that routing and authorization solve different problems.

Routing

Determines who should receive or work on the assignment.

Example: route a Credit Review assignment to a Credit Manager.

Authorization

Determines whether the current user is allowed to perform a particular protected action.

Example: only users with ApproveLoan privilege can approve the loan.

A user can therefore legitimately receive an assignment but still not be authorized for every Flow Action on that assignment.

21. Production Design Considerations

For an enterprise application such as Alpha Bank, the security model should remain maintainable as the application grows.

Use reusable roles

Model business responsibilities through Access Roles rather than creating user-specific rules for every individual.

Use privileges for protected capabilities

If a particular action requires additional authorization, create a meaningful privilege and secure the Flow Action with it.

Use ARO to establish the relationship

Grant the privilege to the appropriate role for the relevant application class.

Use Access When only when conditional authorization is required

If the authorization depends on context such as region, department, or another business attribute, an Access When condition can be used as part of the authorization model.

Keep UI logic separate from security logic

UI conditions can improve the user experience, but security rules should enforce authorization.

22. How to Explain This in a Pega Interview

Sample interview answer:

"Suppose we have an Alpha Bank Loan Application and an Approve Loan Flow Action on the Credit Review assignment. I don't want every user who can access the case to be able to approve the loan. I first create an ApproveLoan privilege and configure that privilege on the Flow Action's Security configuration. Then I grant the privilege to the appropriate Credit Manager role through the Access Role to Object relationship for the Loan Application class. I associate the authorized users with an Access Group that provides that role. If the authorization also depends on a business condition, such as the user's region matching the loan region, I can use an Access When rule on the role/object authorization. At runtime, Pega evaluates the user's security context and the required privilege, so the Credit Manager can see and perform Approve Loan while a Credit Analyst working on the same assignment does not see that Flow Action. I would not rely only on UI visibility because the security boundary should be enforced through Pega's authorization model."

23. Easy Way to Remember the Configuration

1. Privilege
What protected action?
ApproveLoan
2. Flow Action
Secure the action
Approve Loan
3. Access Role
Who generally gets it?
Credit Manager
4. ARO
Role → Object
Loan Application
5. Access When
Optional condition
Is this context allowed?
6. Access Group
Gives user the security context
Credit Managers

Key Takeaway

When you need to restrict an entire Flow Action to specific authorized users, secure the Flow Action itself using Pega's authorization model.

The Alpha Bank implementation can be remembered as:

UserAccess GroupAccess RoleAROPrivilegeFlow Action
+
Access When for conditional authorization

In our example, Sarah's Credit Manager role receives the ApproveLoan privilege through the ARO, so the Approve Loan Flow Action is available to her.

Bob, as a Credit Analyst, can still work on the same Loan Application and the same Credit Review assignment, but because he does not have the required privilege, the Approve Loan action is not available to him.

The key principle is simple: secure the action, not just the button.

Pega Security Connection

Authentication — Who is the user?
Access Group — What application/security context does the user have?
Access Role & ARO — What permissions are associated with the role for the object?
Privilege — Is the user authorized for this specific protected action?
Access When — Does the additional business/security condition allow the action?
Flow Action — The protected business action the user can perform.

No comments:

Post a Comment