Orchestrate

Report an issue

Something wrong, out of date or unclear? Tell us. Corrections are prioritized over new topics. You don't need to sign in.

0 / 2000

Don't include personal or confidential company details. Reports are reviewed with AI assistance.

Business roles in cloud editions: templates, catalogs, restrictions and spaces

Build access in SAP S/4HANA's cloud editions from SAP's templates and catalogs, know what you can and can't change, and keep roles right through each upgrade.

Updated Dec 1, 2026
Foundational layer · 8 min read

The 60-second version

A business role is the access for one job: buyer, AP accountant, receiving clerk. In SAP S/4HANA's cloud editions you don't build that access from raw authorization objects. You assemble it from parts SAP delivers and maintains:

  • Business role templates: SAP's suggested roles for common jobs. You copy them; you don't assign them as they are.
  • Business catalogs: bundles of apps and the authorizations behind them. A role is mostly a list of catalogs.
  • Restrictions: which company codes, plants or purchasing organizations the role reaches, set separately for changing, reading and picking values.
  • Spaces and pages: what the person sees on the launchpad home screen.

SAP owns the catalogs and changes them at every upgrade. You own the roles, their restrictions and who gets them. That split is the whole topic: what you may change, what you can't, and the work it creates twice a year.

Why it matters to the business

Least privilege without a role-building team. In SAP S/4HANA Cloud Public Edition, catalogs are designed to be free of segregation-of-duties conflicts, so customers can mix them into their own roles, per SAP's training (SAP Learning). The conflicts appear when you combine catalogs in one person, and that is a design decision you make.

Licence cost. The same training says Public Edition is priced per user per month, and each catalog carries a price category: Self Service, Core, Advanced, Development Support, or individual pricing for add-ons. One analytics catalog added to a role for 40 buyers can move all 40 to a higher category. Role design is a cost decision.

Upgrades don't stop for your roles. SAP upgrades Public Edition every six months, in February and August, and may deprecate catalogs and give them successors (SAP Community, SAP blog). If nobody adopts the changes, roles drift: apps SAP adds to its templates never reach your people, and outdated catalogs pile up. One SAP blog found 30 deprecated catalogs still in use in a single system (SAP Community, SAP blog).

A procure-to-pay example. At the fictional Calder Pumpworks, a master data specialist whose role holds both "maintain suppliers" and "confirm supplier bank changes" can change Tamsfield Foundry's bank account and confirm it herself. Each catalog is fine on its own. The role that joins them is the fraud risk.

How SAP does it

As of December 2026, SAP's material describes two ways of building business roles, depending on the edition (SAP Learning, Public Edition; SAP Learning, Fiori roles):

SAP S/4HANA Cloud Public Edition SAP S/4HANA Cloud Private Edition and on-premise
Where roles are built Fiori apps: Maintain Business Roles, Business Catalogs, Business Role Templates Transaction PFCG, with launchpad catalogs and spaces in the role menu
SAP's starting point Business role templates to copy SAP_BR_ business roles delivered as templates to copy and refine
Org scope Restrictions per field, for Write, Read and Value Help Org levels and authorization values in PFCG, often derived roles
Can you change SAP's catalogs? No; developers can add catalogs for custom apps Yes, technically, but you then own the difference at every upgrade
Launchpad Spaces and pages assigned to the role Spaces and pages added to the PFCG role menu

Calder's CP10 runs on Private Edition, so its roles live in PFCG, as the roles and authorization design topic showed; the SAP authorization concept in depth explains the checks underneath both editions. This topic uses Public Edition as a what-if, because its model is the strictest form of "SAP owns the parts, you own the roles", and then maps each idea back to Private Edition.

What you may change, and what you can't

This is the table to bring to the first access workshop. It is for Public Edition, where the line is drawn most sharply.

Object Who owns it What you can do
Business role template SAP Copy it, compare your role with it after an upgrade. Don't assign it in production.
Business catalog SAP Add it to or remove it from your roles. You can't create or edit SAP's catalogs, per SAP Support (SAP Community Q&A).
Restriction types and fields SAP Fill them with your values (company code CP10, plant CP11). You can't add fields.
Your business role You Everything: name, catalogs, restrictions, spaces, users, owner.
Spaces and pages Both Copy SAP's spaces to edit them; create your own (SAP Learning).
Custom apps You Key users publish a custom app into an existing catalog; developers create their own catalogs for custom apps.

Questions to ask

  1. Who owns each business role, and who approves a change to it?
  2. Which SAP templates did we copy, and where do our roles differ on purpose? Is that written down?
  3. Which catalogs in each role carry a higher price category, and did finance budget for it?
  4. Which roles have Write or Read set to Unrestricted, and why?
  5. Which catalog combinations do we never give to one person?
  6. Who reviews deprecated catalogs and template changes before each upgrade, and in which tenant?
  7. When a custom app is built, which catalog, role and page will make it visible?
  8. For Private Edition: which SAP_BR_ roles did we copy, and do we compare our copies after each release?

Common misconceptions

  • "We can use SAP's standard roles to go live faster." SAP's training says standard roles suit demos and testing, not a customer's production system, for least privilege and cost.
  • "Restricted in one role means restricted for the user." If another role gives the same field unrestricted, the restriction no longer applies, as SAP's blog on restrictions shows (SAP Community).
  • "SAP keeps our roles current." SAP keeps its catalogs and templates current. Adopting the changes in your roles is your job.
  • "A role without a space still works." The apps may be authorized, but every Public Edition role needs at least one space and one page, or the launchpad shows the person nothing.
  • "Catalogs are safe to combine." Each catalog is designed to avoid conflicts on its own. Two catalogs in one person can still form one.

Key terms

All course terms, A to Z, in the glossary

  • Business role: the access for one job, built from catalogs, restrictions and spaces, and assigned to business users.
  • Business role template: SAP's suggested role for a job, delivered to copy, not to assign.
  • Business catalog: a bundle of apps and their authorizations that SAP delivers and maintains.
  • Restriction type: a group of fields (such as company code) that limits which data a catalog's apps reach.
  • Access category: Write, Read or Value Help, each set to Unrestricted, Restricted or No Access.
  • Price category: the licence level a catalog carries in Public Edition, such as Core or Advanced.
  • Space and page: the launchpad layout a role shows: a space holds pages, a page holds tiles.
  • Deprecated catalog: a catalog SAP plans to remove, usually with a named successor to adopt.

Check yourself

Pick one answer for each question. The explanation appears after you choose.

1Your partner proposes assigning SAP's buyer template directly to Calder's buyers to save time. What is the right answer?

Answer: A. SAP's training says standard roles are for demos and testing, not production, for least privilege and cost. A copy can be restricted to Calder's org units and owned by a named person.

2Which part of a Public Edition business role can a customer not change?

Answer: A. SAP Support states that customers can't create or modify SAP's business catalogs. Customers choose catalogs, fill restrictions, pick spaces and assign users; developers can add catalogs only for custom apps.

3Finance asks why the AP team's licence cost rose after a role change. What should you check first?

Answer: C. In Public Edition each catalog carries a price category, and users are priced per user per month. Adding one higher-category catalog to a shared role can raise every holder's category.

4A master data specialist's role holds supplier maintenance and bank-change confirmation. Each catalog is SAP's. Where is the risk?

Answer: B. SAP designs catalogs to be free of conflicts on their own so they can be mixed. The conflict appears when one person can both change and confirm bank details, which is a role design decision.

5SAP deprecates a catalog in the February upgrade and names a successor. What happens if nobody acts?

Answer: D. SAP marks the catalog deprecated and names the successor; customers adopt the change in their roles. Left alone, the role drifts from SAP's content: SAP's own blog found dozens of deprecated catalogs still in use in one system.

6A user's AP role is restricted to CP10, but she also holds an analytics role with company code unrestricted. What does she see?

Answer: A. SAP's blog on restrictions shows that an unrestricted field in a second role lifts the restriction for the user. Review users' combined access, not roles one at a time.
Deep layer · 38 min read

Mental model

Think of a business role as a recipe written against SAP's pantry. SAP stocks the pantry: templates, catalogs, restriction types. It restocks twice a year, renames jars and retires some. You write the recipes: which catalogs, which org values, which launchpad layout, for which people. You can't open a jar and change what's inside it.

flowchart LR
  subgraph SAPSIDE["SAP owns"]
    T[Business role template]
    C[Business catalogs]
    R[Restriction types and fields]
  end
  subgraph YOURS["You own"]
    B[Business role]
    V[Restriction values<br/>CP10, CP11, PUUS]
    S[Spaces and pages]
    U[Business users]
  end
  T -- copy --> B
  C --> B
  R --> V --> B
  S --> B
  B --> U

Three consequences follow, and every section below comes back to them:

  1. Access is the sum of a person's roles. You review users, not roles one by one.
  2. Your roles drift from SAP's content. Each upgrade produces a list of changes to adopt or decline on purpose.
  3. Your change surface is small and fixed. Anything you need beyond it (a custom app, a custom check) is an extension with its own catalog.

How it works

The objects, from user to value

SAP's blog on restrictions lays out the chain: users hold business roles; a role holds business catalogs and restrictions and is linked to spaces; catalogs bring apps and are linked to pages; restriction types bundle restriction fields; fields hold values (SAP Community). The same restriction type is used by many catalogs, and two roles can fill the same field with different values.

Object Example at Calder (what-if) Who changes it
Business user 00100241, AP accountant Created from HR; roles assigned by IAM administrators
Business role ZBR_AP_ACCOUNTANT Calder
Business catalog Supplier invoice processing SAP
Restriction type One for supplier invoices, with field Company Code SAP
Restriction value Company Code CP10 Calder
Space and page ZSP_P2P with pages for purchasing and invoices Calder (copies of SAP's)

Technical users are separate. SAP's training lists Maintain Business Users for people and Display Technical Users for system users, such as SAP support access (SAP Learning). Integrations use communication users and arrangements, a subject for the integration units.

Access categories and restrictions

Each Public Edition role has three access categories: Write, Read and Value Help. Each one is set to Unrestricted, Restricted or No Access (SAP Community). SAP's training gives the defaults of a new role and what to do with them (SAP Learning):

Category Default in a new role SAP's training advises
Write, Read, Value Help No Access Set to Restricted and maintain values
Read, Value Help Unrestricted Set to Restricted so people see only their data
Value Help Unrestricted Decide per field whether values are sensitive

Write values are inherited by Read and Value Help. "Not maintained" denies a field on purpose. After setting the categories, Maintain Restrictions opens each restriction type; you set the field to Restricted and tick values (SAP Learning). The Leading Restriction checkbox pushes a field's values to every other restriction type in the role that uses the same field, so company code CP10 is entered once. SAP's lesson warns against Unrestricted unless it is really needed.

Two behaviours matter for design:

  • Restrictions add up across roles. SAP's blog shows a cash manager role restricted to US banks losing that restriction when the user also holds a role where the field is unrestricted. The effective access is the widest of the person's roles.
  • A role can authorize an app and find no data. If Write stays No Access while a catalog's app needs to post, the tile opens and the posting fails. The fix is in the categories, not the catalog.

To find which catalogs use a restriction type, the Business Catalogs app has a Restriction Types tab and the Display Restriction Types app goes the other way. The IAM Information System shows how catalogs, restrictions, roles and users relate. Since release 2302, Maintain Business Roles has a mass change for restriction values across roles (SAP Community).

Templates and price categories

A role starts from the Business Role Templates app or from scratch. SAP's example copies the template SAP_BR_CASH_MANAGER into a customer role and restricts it. SAP's training adds that standard roles are for the Starter system and development tenants, not production, and that a role's price category column shows the licence level its catalogs need. Building proper roles "can take several weeks or months", it warns, and recommends starting from the Application Workplace List accelerator in SAP Activate, filled by the lead authorization expert with each business area's data owner (SAP Learning).

Spaces and pages

The launchpad shows what the role's spaces and their pages hold. Every Public Edition role needs at least one of each. Authorization and visibility are separate: a tile appears only if its catalog is in one of the user's roles and a page in one of the user's spaces shows it. SAP's custom-UI lesson puts it the same way: the app's catalog and the space holding its page must belong to the same role. Spaces whose IDs start with SAP_ or BR_ can't be edited; Create Spaces Based on SAP-Delivered Spaces makes an editable copy (SAP Learning).

Custom apps and custom catalogs

You can't edit SAP's catalogs, but your own apps need a way in. Two routes exist, per SAP's material:

  • Key users create a tile in Custom Tiles, publish it into an existing business catalog with Custom Catalog Extensions, and place it with Manage Launchpad Pages (SAP Learning).
  • Developers using developer extensibility in ABAP Development Tools can create business catalogs that contain their own IAM apps, according to SAP Support (SAP Community Q&A).

The architect's choice: publishing into an SAP catalog gives the app to everyone who holds that catalog, which may be more people than intended. A developer catalog gives you a separate thing to assign and price.

The upgrade cycle

SAP's two blog posts on upgrades describe the routine (before the upgrade; after the upgrade). The posts use the 2308 to 2402 upgrade as their example.

sequenceDiagram
  participant SAP
  participant IAM as Calder IAM admin
  participant Test as Test tenant
  participant Dev as Development tenant
  participant Prod as Production
  SAP->>IAM: What's New, IAM change overview note, change files
  IAM->>IAM: Which changes touch roles in use?
  SAP->>Test: Upgrade (first)
  IAM->>Test: Check affected roles, try the changes
  SAP->>Dev: Upgrade (about three weeks later)
  SAP->>Prod: Upgrade
  IAM->>Dev: Adopt SAP changes, adapt Calder roles
  Dev->>Prod: Export Software Collection (transport)
  • Before. The What's New Viewer, filtered to identity and access management, lists catalog and restriction changes. SAP Note 2975653 is the central change overview for IAM. In the Business Catalogs app, filter on status Deprecated; each deprecated catalog shows its successor. The blog adds that catalogs can depend on others, so adopting a successor may pull in mandatory dependencies.
  • After. Manage Business Roles after Upgrade shows five tabs: restriction types, catalog dependencies, deprecated catalogs, business role templates and affected business roles. In Maintain Business Roles, Adopt Changes swaps successors in. The Business Role Templates app compares a role with its template; the blog suggests documenting catalogs you leave out on purpose, because the comparison flags them again next time.
  • Moving the result. Changes are made in the development system's customizing tenant and moved with the Export Software Collection app.

SAP's blog uses a convention worth keeping: you adopt SAP's objects and adapt your own roles.

Troubleshooting a refused app

When a user can't see or do something, the Display Authorization Trace app records checks for one business user and chosen apps, each marked successful, failed or filtered. For a filtered check, look at which roles expose the restriction type and whether the value is maintained (SAP Learning). Traces are deleted after a while, so read them soon. SAP's restriction lesson adds: test every changed role with a test user before it reaches people.

The same ideas in Private Edition

In Private Edition and on-premise, which is where Calder's CP10 lives, SAP still delivers business roles as templates, named SAP_BR_, each with a matching PFCG role. You copy and refine them, or build from scratch. In the PFCG role menu you insert launchpad catalogs and launchpad spaces; SU24 authorization defaults fill the authorizations, and you adjust them. When a catalog changes, the report PRGN_COMPARE_ROLE_MENU lists roles to adapt (SAP Learning).

For a first look at SAP's content, the task list SAP_FIORI_CONTENT_ACTIVATION activates apps, services and generated template roles for chosen SAP_BR roles, optionally with test users. SAP's lesson says to run at most 100 roles at a time, to apply SAP Note 2686456 first, and that the task list is meant for sandbox systems (SAP Learning). Customer spaces start with Z or Y, a space change needs a customizing transport, and SAP's best practice is one space per business role (SAP Learning).

How those PFCG roles, proposals and checks work is the subject of the SAP authorization concept in depth. The difference is freedom, and with it ownership. In PFCG you can change almost anything, including authorization values SAP proposed. Every change is then yours to compare and carry at each release.

Build it yourself: review Calder's business roles before and after an upgrade

You will run a small script that holds Calder's procure-to-pay roles, built the Public Edition way as a what-if. It checks them against eleven course rules, explains one user's combined access, and then plays an upgrade: SAP deprecates a catalog and adds one to a template, and you adopt the changes.

flowchart LR
  A[business_roles.py --init] --> B[draft design<br/>rules B01-B11]
  B --> C[one user: 00100241]
  B --> D[reviewed design]
  D --> E[upgrade to<br/>release 2702]
  E --> F[adopt successors]
  F --> G[your decisions<br/>exercise]

Before you start: complete Set up your computer for this course and, ideally, Set up for Unit 27. The roles and authorization design topic introduced the same people and duties in PFCG terms; this walkthrough doesn't need it, but reading it first helps.

What you need

  • Your course folder orchestrate-course with its .venv.
  • About 30 to 40 minutes. Free; no account, no internet.
  • Built-in Python modules only, so nothing to add to requirements.txt.

Step 1: Open your course folder and turn on the virtual environment

  1. Open VS Code, choose File > Open Folder, and open orchestrate-course.

  2. Open a terminal: Terminal > New Terminal.

  3. If the prompt doesn't start with (.venv), turn it on:

    • Windows (PowerShell):

      .venv\Scripts\Activate.ps1
    • macOS / Linux:

      source .venv/bin/activate
  4. If unit27 doesn't exist yet (you skipped the Unit 27 setup), create it:

    mkdir unit27

Run every command from the course folder.

Step 2: Create the script

  1. In VS Code, create unit27/business_roles.py, paste the code below and save.
"""Review Calder's business roles the way a cloud edition builds them (Unit 27).

Course stand-in, built-in modules only, no randomness. Catalogs, templates,
restriction types, price categories and rules B01-B11 are course labels, not
SAP's delivered content. Calder's CP10 runs on Private Edition; this lab is a
what-if: the same procure-to-pay jobs built the Public Edition way.
"""
import argparse
import json
import pathlib
import sys
import tempfile

HERE = pathlib.Path(__file__).resolve().parent
DATA = HERE / "broles"
LEVELS = {"Self Service": 1, "Core": 2, "Advanced": 3}

# ---------------------------------------------------------------- sample data
RESTRICTION_TYPES = {
    "RT_PURCH_DOC": ["PurchasingOrganization", "Plant"],
    "RT_GOODS_MVMT": ["Plant"],
    "RT_SUPPLIER_INV": ["CompanyCode"],
    "RT_PAYMENT": ["CompanyCode"],
    "RT_SUPPLIER": ["CompanyCode"],
    "RT_ANALYTICS": ["CompanyCode"],
}

CATALOGS = {
    "BC_PO_PROCESS": {"text": "Purchase order processing", "price": "Core", "write": True, "types": ["RT_PURCH_DOC"], "status": "Released"},
    "BC_PO_DISPLAY": {"text": "Purchase order display", "price": "Core", "write": False, "types": ["RT_PURCH_DOC"], "status": "Released"},
    "BC_PO_APPROVE_OLD": {"text": "Purchase order approval (old)", "price": "Core", "write": True, "types": ["RT_PURCH_DOC"],
                          "status": "Deprecated", "successor": "BC_PO_APPROVE"},
    "BC_PO_APPROVE": {"text": "Purchase order approval", "price": "Core", "write": True, "types": ["RT_PURCH_DOC"], "status": "Released"},
    "BC_GR_POST": {"text": "Goods receipt", "price": "Core", "write": True, "types": ["RT_GOODS_MVMT"], "status": "Released"},
    "BC_SUPINV_PROCESS": {"text": "Supplier invoice processing", "price": "Core", "write": True, "types": ["RT_SUPPLIER_INV"], "status": "Released"},
    "BC_PAYMENT_RUN": {"text": "Payment run", "price": "Core", "write": True, "types": ["RT_PAYMENT"], "status": "Released"},
    "BC_SUPPLIER_MAINT": {"text": "Supplier master maintenance", "price": "Core", "write": True, "types": ["RT_SUPPLIER"], "status": "Released"},
    "BC_SUPPLIER_BANK_CONFIRM": {"text": "Confirm supplier bank changes", "price": "Core", "write": True, "types": ["RT_SUPPLIER"], "status": "Released"},
    "BC_PROC_ANALYTICS": {"text": "Procurement analytics", "price": "Advanced", "write": False, "types": ["RT_ANALYTICS"], "status": "Released"},
    "BC_ESS": {"text": "Employee self-service", "price": "Self Service", "write": False, "types": [], "status": "Released"},
}

TEMPLATES = {
    "TPL_BUYER": ["BC_PO_PROCESS", "BC_PO_DISPLAY", "BC_PROC_ANALYTICS"],
    "TPL_PURCH_MANAGER": ["BC_PO_APPROVE", "BC_PO_DISPLAY", "BC_PROC_ANALYTICS"],
    "TPL_RECEIVING": ["BC_GR_POST", "BC_PO_DISPLAY"],
    "TPL_AP_ACCOUNTANT": ["BC_SUPINV_PROCESS", "BC_PO_DISPLAY", "BC_PAYMENT_RUN"],
    "TPL_MD_SPECIALIST": ["BC_SUPPLIER_MAINT", "BC_SUPPLIER_BANK_CONFIRM"],
    "TPL_EMPLOYEE": ["BC_ESS"],
}

CONFLICTS = [  # course SoD pairs: catalogs SAP keeps apart, combined in one person
    ("BC_PO_PROCESS", "BC_SUPINV_PROCESS", "create purchase orders and post their invoices"),
    ("BC_SUPPLIER_MAINT", "BC_PAYMENT_RUN", "change suppliers and pay them"),
    ("BC_SUPPLIER_MAINT", "BC_SUPPLIER_BANK_CONFIRM", "change bank details and confirm the change"),
]

LICENSE = {  # price category each user is budgeted at (course plan)
    "00100211": "Core", "00100253": "Advanced", "00100247": "Core", "00100241": "Core",
    "00100244": "Core", "00100250": "Core", "00100262": "Core", "00100280": "Advanced",
}

US = {"CompanyCode": ["CP10"], "PurchasingOrganization": ["PUUS"], "Plant": ["CP11"]}
UNR = {"write": "Unrestricted", "read": "Unrestricted", "value_help": "Unrestricted"}
RES = {"write": "Restricted", "read": "Restricted", "value_help": "Restricted"}


def role(rid, text, tpl, cats, owner, users, cat=None, values=None, spaces=("ZSP_P2P",), omitted=None):
    return {"id": rid, "text": text, "template": tpl, "catalogs": list(cats), "owner": owner, "users": list(users),
            "access": dict(RES if cat is None else cat), "values": dict(US if values is None else values), "spaces": list(spaces), "omitted": dict(omitted or {})}


def draft():
    return {
        "roles": [
            role("TPL_BUYER", "SAP template, assigned as is", None, TEMPLATES["TPL_BUYER"], "00100253", ["00100211"], UNR, {}),
            role("ZBR_PURCH_MANAGER_US", "Purchasing manager, Rockford", "TPL_PURCH_MANAGER",
                 ["BC_PO_APPROVE_OLD", "BC_PO_DISPLAY", "BC_PROC_ANALYTICS"], "00100253", ["00100253"],
                 omitted={"BC_PO_APPROVE": "kept the old approval catalog"}),
            role("ZBR_RECEIVING_US", "Receiving clerk, Rockford", "TPL_RECEIVING", TEMPLATES["TPL_RECEIVING"], "00100247",
                 ["00100247"], {"write": "No Access", "read": "Restricted", "value_help": "Restricted"}, spaces=[]),
            role("ZBR_AP_ACCOUNTANT", "AP accountant", "TPL_AP_ACCOUNTANT", ["BC_SUPINV_PROCESS", "BC_PO_DISPLAY"],
                 "00100244", ["00100241"]),
            role("ZBR_AP_SUPERVISOR", "AP supervisor", "TPL_AP_ACCOUNTANT", TEMPLATES["TPL_AP_ACCOUNTANT"], "00100244",
                 ["00100244"], {"write": "Unrestricted", "read": "Unrestricted", "value_help": "Unrestricted"}, {}),
            role("ZBR_MD_SPECIALIST", "Master data specialist", "TPL_MD_SPECIALIST", TEMPLATES["TPL_MD_SPECIALIST"],
                 "00100250", ["00100250"], values={"CompanyCode": ["CP10"]}),
            role("ZBR_ANALYTICS_ALL", "Spend analytics for everyone", None, ["BC_PROC_ANALYTICS"], None,
                 ["00100241", "00100280"], {"write": "No Access", "read": "Unrestricted", "value_help": "Unrestricted"}, {}),
            role("ZBR_EMPLOYEE", "Every employee", "TPL_EMPLOYEE", TEMPLATES["TPL_EMPLOYEE"], "00100306",
                 list(LICENSE), values={}, spaces=["ZSP_EMPLOYEE"]),
        ],
        "spaces": {"ZSP_P2P": ["ZPG_PURCHASING", "ZPG_INVOICES"], "ZSP_EMPLOYEE": ["ZPG_MY_WORK"], "ZSP_RECEIVING": ["ZPG_RECEIVING"]},
        "custom_apps": [{"app": "YY1_QUOTECHECK_UI5R", "text": "Supplier quote check", "catalog": "BC_PO_PROCESS",
                         "page": "ZPG_RECEIVING"}],
    }


def reviewed():
    d = draft()
    r = {x["id"]: x for x in d["roles"]}
    buyer = role("ZBR_BUYER_US", "Buyer, Rockford", "TPL_BUYER", ["BC_PO_PROCESS", "BC_PO_DISPLAY"], "00100253",
                 ["00100211"], omitted={"BC_PROC_ANALYTICS": "Advanced price category; buyers use the manager's spend reports"})
    r["ZBR_PURCH_MANAGER_US"]["catalogs"] = ["BC_PO_APPROVE", "BC_PO_DISPLAY", "BC_PROC_ANALYTICS"]
    r["ZBR_PURCH_MANAGER_US"]["omitted"] = {}
    r["ZBR_RECEIVING_US"].update(access=dict(RES), values={"Plant": ["CP11"], "PurchasingOrganization": ["PUUS"]},
                                 spaces=["ZSP_RECEIVING"])
    r["ZBR_AP_ACCOUNTANT"].update(access=dict(RES), values={"CompanyCode": ["CP10"], "PurchasingOrganization": ["PUUS"], "Plant": ["CP11"]},
                                  omitted={"BC_PAYMENT_RUN": "payment runs belong to the AP supervisor"})
    r["ZBR_AP_SUPERVISOR"].update(access=dict(RES), values={"CompanyCode": ["CP10", "CP20"],
                                  "PurchasingOrganization": ["PUUS", "PUDE"], "Plant": ["CP11", "CP21"]})
    r["ZBR_MD_SPECIALIST"].update(catalogs=["BC_SUPPLIER_MAINT"], omitted={"BC_SUPPLIER_BANK_CONFIRM": "confirmed by the steward, ZBR_MD_STEWARD"})
    steward = role("ZBR_MD_STEWARD", "Supplier data steward", "TPL_MD_SPECIALIST", ["BC_SUPPLIER_BANK_CONFIRM"], "00100250",
                   ["00100262"], values={"CompanyCode": ["CP10"]}, omitted={"BC_SUPPLIER_MAINT": "the steward confirms, never changes"})
    r["ZBR_ANALYTICS_ALL"].update(id="ZBR_SPEND_ANALYST", text="Spend analytics, group controller", owner="00100280",
                                  users=["00100280"], access={"write": "No Access", "read": "Restricted", "value_help": "Restricted"},
                                  values={"CompanyCode": ["CP10", "CP20"]})
    d["roles"] = [buyer, r["ZBR_PURCH_MANAGER_US"], r["ZBR_RECEIVING_US"], r["ZBR_AP_ACCOUNTANT"], r["ZBR_AP_SUPERVISOR"],
                  r["ZBR_MD_SPECIALIST"], steward, r["ZBR_ANALYTICS_ALL"], r["ZBR_EMPLOYEE"]]
    d["custom_apps"][0]["page"] = "ZPG_PURCHASING"
    return d


RELEASE_2702 = {
    "release": "2702",
    "new_catalogs": {"BC_PO_DISPLAY_V2": {"text": "Purchase order display", "price": "Core", "write": False, "types": ["RT_PURCH_DOC"], "status": "Released"},
                     "BC_SUPINV_MONITOR": {"text": "Supplier invoice monitor", "price": "Core", "write": True, "types": ["RT_SUPPLIER_INV"], "status": "Released"}},
    "deprecated": {"BC_PO_DISPLAY": "BC_PO_DISPLAY_V2"},
    "removed": ["BC_PO_APPROVE_OLD"],
    "template_added": {"TPL_AP_ACCOUNTANT": ["BC_SUPINV_MONITOR"]},
}


# ---------------------------------------------------------------- file helpers
def write_json(path, obj):
    path.write_text(json.dumps(obj, indent=2) + "\n", encoding="utf-8")


def init(folder, quiet=False):
    if folder.exists():
        sys.exit(f"{folder} already exists; delete it first if you want the sample back.")
    folder.mkdir(parents=True)
    write_json(folder / "content.json", {"restriction_types": RESTRICTION_TYPES, "catalogs": CATALOGS,
                                         "templates": TEMPLATES, "conflicts": CONFLICTS, "license": LICENSE})
    write_json(folder / "roles_draft.json", draft())
    write_json(folder / "roles_reviewed.json", reviewed())
    write_json(folder / "release_2702.json", RELEASE_2702)
    if not quiet:
        print(f"Wrote 4 files to {folder.parent.name}/{folder.name}")


def load(folder, design, upgrade=False):
    try:
        content = json.loads((folder / "content.json").read_text(encoding="utf-8"))
        roles = json.loads((folder / f"roles_{design}.json").read_text(encoding="utf-8"))
        rel = json.loads((folder / "release_2702.json").read_text(encoding="utf-8")) if upgrade else None
    except FileNotFoundError as e:
        sys.exit(f"Cannot read {e.filename}: run with --init first.")
    except json.JSONDecodeError as e:
        sys.exit(f"A JSON file is broken ({e}); undo your last edit.")
    if rel:  # what SAP's upgrade changes in delivered content
        content["catalogs"].update(rel["new_catalogs"])
        for old, new in rel["deprecated"].items():
            content["catalogs"][old].update(status="Deprecated", successor=new)
            for tpl, cs in content["templates"].items():  # SAP's templates move to the successor
                content["templates"][tpl] = [new if c == old else c for c in cs]
        for gone in rel["removed"]:
            content["catalogs"][gone]["status"] = "Removed"
        for tpl, added in rel["template_added"].items():
            content["templates"][tpl] = content["templates"][tpl] + added
    return content, roles, rel


# ---------------------------------------------------------------- the rules
def check(content, design):
    cats, tpls = content["catalogs"], content["templates"]
    rtypes, lic = content["restriction_types"], content["license"]
    roles = design["roles"]
    out = []

    def add(rule, verdict, text):
        out.append((rule, verdict, text))

    for r in roles:
        rid = r["id"]
        unknown = [c for c in r["catalogs"] if c not in cats]
        if unknown:
            add("B00", "FAIL", f"{rid}: unknown catalog {', '.join(unknown)}")
        # B01 templates are copied, never assigned
        if rid in tpls:
            add("B01", "FAIL", f"{rid} is an SAP template assigned to {', '.join(r['users'])}; copy it instead")
        else:
            add("B01", "OK", f"{rid} is a customer role")
        # B02 at least one space with a page
        pages = [p for s in r["spaces"] for p in design["spaces"].get(s, [])]
        add("B02", "OK" if pages else "FAIL", f"{rid}: " + (f"{len(pages)} page(s)" if pages else "no space or page; the launchpad is empty"))
        # B03 access categories
        a = r["access"]
        if a["write"] == "Unrestricted":
            add("B03", "FAIL", f"{rid}: Write is Unrestricted")
        elif a["read"] == "Unrestricted":
            add("B03", "WARN", f"{rid}: Read and Value Help are Unrestricted")
        else:
            add("B03", "OK", f"{rid}: no unrestricted Write or Read")
        # B04 restricted fields have values; write not blocked when a catalog needs it
        fields = sorted({f for c in r["catalogs"] if c in cats for t in cats[c]["types"] for f in rtypes[t]})
        missing = [f for f in fields if "Restricted" in (a["write"], a["read"]) and not r["values"].get(f)]
        write_needed = [c for c in r["catalogs"] if c in cats and cats[c]["write"]]
        if a["write"] == "No Access" and write_needed:
            add("B04", "FAIL", f"{rid}: Write is No Access but {', '.join(write_needed)} needs it; the apps open and can't post")
        elif missing:
            add("B04", "FAIL", f"{rid}: no values for {', '.join(missing)}")
        else:
            add("B04", "OK", f"{rid}: every restricted field has values")
        # B08 deprecated or removed catalogs
        old = [c for c in r["catalogs"] if c in cats and cats[c]["status"] != "Released"]
        for c in old:
            v = "FAIL" if cats[c]["status"] == "Removed" else "WARN"
            add("B08", v, f"{rid}: {c} is {cats[c]['status'].lower()}" + (f", successor {cats[c]['successor']}" if cats[c].get("successor") else ""))
        if not old:
            add("B08", "OK", f"{rid}: no deprecated catalogs")
        # B09 differences from the template are recorded
        if r.get("template") in tpls:
            gap = [c for c in tpls[r["template"]] if c not in r["catalogs"] and c not in r["omitted"]]
            add("B09", "WARN" if gap else "OK", f"{rid}: " + (f"{', '.join(gap)} in {r['template']} left out without a reason" if gap else f"matches {r['template']} or says why not"))
        # B10 owner
        add("B10", "OK" if r.get("owner") else "FAIL", f"{rid}: owner {r.get('owner') or 'missing'}")

    # per user: B05 SoD, B06 overrides, B07 price category
    users = sorted({u for r in roles for u in r["users"]})
    for u in users:
        held = [r for r in roles if u in r["users"]]
        ucats = {c for r in held for c in r["catalogs"]}
        clash = [f"{why} ({a} + {b})" for a, b, why in content["conflicts"] if a in ucats and b in ucats]
        add("B05", "FAIL" if clash else "OK", f"{u}: " + ("; ".join(clash) if clash else "no conflicting catalogs"))
        overridden = []
        for r in held:
            if r["access"]["read"] != "Restricted":
                continue
            own = {f for c in r["catalogs"] if c in cats for t in cats[c]["types"] for f in rtypes[t]}
            for f in sorted(own & set(r["values"])):
                for o in held:
                    if o is not r and o["access"]["read"] == "Unrestricted" and any(
                            f in rtypes[t] for c in o["catalogs"] if c in cats for t in cats[c]["types"]):
                        overridden.append(f"{f} in {r['id']} overridden by {o['id']}")
        add("B06", "WARN" if overridden else "OK", f"{u}: " + ("; ".join(sorted(set(overridden))) if overridden else "no restriction overridden"))
        need = max((cats[c]["price"] for c in ucats if c in cats), key=LEVELS.get, default="Self Service")
        plan = lic.get(u, "Self Service")
        add("B07", "FAIL" if LEVELS[need] > LEVELS[plan] else "OK", f"{u}: needs {need}, budgeted {plan}")

    # B11 custom tiles reach a role that holds the catalog and shows the page
    for app in design.get("custom_apps", []):
        space = next((s for s, ps in design["spaces"].items() if app["page"] in ps), None)
        ok = [r["id"] for r in roles if app["catalog"] in r["catalogs"] and space in r["spaces"]]
        add("B11", "OK" if ok else "FAIL", f"{app['app']}: " + (f"visible to {', '.join(ok)}" if ok else
            f"catalog {app['catalog']} and page {app['page']} sit in no common role; nobody sees the tile"))
    return out


def affected(content, design, rel):
    """What an upgrade asks of each role: SAP's three kinds of change."""
    rows = []
    for r in design["roles"]:
        for c in r["catalogs"]:
            if c in rel["deprecated"]:
                rows.append((r["id"], "Deprecated catalog", f"{c}: adopt successor {rel['deprecated'][c]}"))
            if c in rel["removed"]:
                rows.append((r["id"], "Removed catalog", f"{c}: remove or replace before the upgrade"))
        for c in rel["template_added"].get(r.get("template"), []):
            if c not in r["catalogs"] and c not in r["omitted"]:
                rows.append((r["id"], "Template change", f"{r['template']} now has {c}: add it or record why not"))
    return rows


def adopt(folder, design_name, content, design, rel):
    """Like Adopt Changes: swap deprecated catalogs for their successors. Template changes stay a decision."""
    n = 0
    for r in design["roles"]:
        for i, c in enumerate(r["catalogs"]):
            if c in rel["deprecated"]:
                r["catalogs"][i] = rel["deprecated"][c]
                n += 1
    write_json(folder / f"roles_{design_name}.json", design)
    print(f"Adopted {n} successor catalog(s) in roles_{design_name}.json")


def explain(content, design, user):
    cats, rtypes = content["catalogs"], content["restriction_types"]
    held = [r for r in design["roles"] if user in r["users"]]
    if not held:
        sys.exit(f"{user} holds no role in this design.")
    print(f"User {user}")
    for r in held:
        print(f"  {r['id']:<22} {', '.join(r['catalogs'])}")
    fields = {}
    for r in held:
        for c in r["catalogs"]:
            for t in cats.get(c, {}).get("types", []):
                for f in rtypes[t]:
                    vals = "*" if r["access"]["read"] == "Unrestricted" else ",".join(r["values"].get(f, [])) or "(none)"
                    fields.setdefault(f, set()).add(vals)
    print("  Read access by field (all roles together):")
    for f, vals in sorted(fields.items()):
        eff = "* (any value)" if "*" in vals else ",".join(sorted(vals))
        print(f"    {f:<24} {eff}")
    need = max((cats[c]["price"] for r in held for c in r["catalogs"] if c in cats), key=LEVELS.get)
    print(f"  Price category of the user: {need}")


def report(rows, title):
    print(title)
    for rule, verdict, text in sorted(rows, key=lambda x: (x[0], x[2])):
        if verdict != "OK":
            print(f"  {verdict:<4}  {rule}  {text}")
    n = {v: sum(1 for x in rows if x[1] == v) for v in ("OK", "WARN", "FAIL")}
    print(f"{n['OK']} OK, {n['WARN']} WARN, {n['FAIL']} FAIL (synthetic data)")
    return n


def selftest():
    with tempfile.TemporaryDirectory() as tmp:
        folder = pathlib.Path(tmp) / "broles"
        init(folder, quiet=True)
        c, d, _ = load(folder, "draft")
        dv = {(r, v) for r, v, _ in check(c, d)}
        for want in [("B01", "FAIL"), ("B02", "FAIL"), ("B03", "FAIL"), ("B04", "FAIL"), ("B05", "FAIL"),
                     ("B06", "WARN"), ("B07", "FAIL"), ("B08", "WARN"), ("B09", "WARN"), ("B10", "FAIL"), ("B11", "FAIL")]:
            assert want in dv, want
        c, d, _ = load(folder, "reviewed")
        assert all(v == "OK" for _, v, _ in check(c, d)), "reviewed design should pass"
        c, d, rel = load(folder, "reviewed", upgrade=True)
        assert len(affected(c, d, rel)) == 7, len(affected(c, d, rel))
    print("Self-test passed.")


def main():
    p = argparse.ArgumentParser(description="Review business roles built from catalogs (course stand-in).")
    p.add_argument("--init", action="store_true", help="write the sample files")
    p.add_argument("--design", choices=["draft", "reviewed"], default="draft")
    p.add_argument("--user", help="explain one user's access, e.g. 00100241")
    p.add_argument("--upgrade", action="store_true", help="apply release 2702's content changes first")
    p.add_argument("--adopt", action="store_true", help="with --upgrade: adopt successor catalogs in the design file")
    p.add_argument("--selftest", action="store_true")
    a = p.parse_args()
    if a.selftest:
        return selftest()
    if a.init:
        return init(DATA)
    content, design, rel = load(DATA, a.design, a.upgrade)
    if a.adopt:
        if not rel:
            sys.exit("--adopt needs --upgrade: there is nothing to adopt before the release.")
        adopt(DATA, a.design, content, design, rel)
    if a.user:
        return explain(content, design, a.user)
    if rel:
        rows = affected(content, design, rel)
        print(f"Affected business roles after release {rel['release']} ({a.design}):")
        for rid, kind, text in rows:
            print(f"  {rid:<22} {kind:<20} {text}")
        print(f"{len(rows)} change(s) to review")
    n = report(check(content, design), f"Rules B01-B11 on the {a.design} design" + (" after the upgrade" if rel else ""))
    if n["FAIL"]:
        sys.exit(2)


if __name__ == "__main__":
    main()
  1. Check the script against itself:

    python unit27/business_roles.py --selftest
    Self-test passed.

    On macOS or Linux, use python3 if python isn't found.

Step 3: Write the sample files

python unit27/business_roles.py --init
Wrote 4 files to unit27/broles
File What it holds
content.json SAP's side (stand-ins): restriction types, catalogs with price category and status, templates, the conflict pairs, and Calder's licence plan per user
roles_draft.json The partner's first draft of Calder's roles, spaces and one custom app
roles_reviewed.json The same jobs after the architect's review
release_2702.json What a course release 2702 changes in SAP's content

Open roles_draft.json and find ZBR_AP_ACCOUNTANT. Its access holds the three categories, values the restriction values (as if Leading Restriction were on), and omitted the template catalogs it leaves out with a reason.

Step 4: Review the draft

python unit27/business_roles.py
Rules B01-B11 on the draft design
  FAIL  B01  TPL_BUYER is an SAP template assigned to 00100211; copy it instead
  FAIL  B02  ZBR_RECEIVING_US: no space or page; the launchpad is empty
  FAIL  B03  TPL_BUYER: Write is Unrestricted
  WARN  B03  ZBR_ANALYTICS_ALL: Read and Value Help are Unrestricted
  FAIL  B03  ZBR_AP_SUPERVISOR: Write is Unrestricted
  FAIL  B04  ZBR_RECEIVING_US: Write is No Access but BC_GR_POST needs it; the apps open and can't post
  FAIL  B05  00100250: change bank details and confirm the change (BC_SUPPLIER_MAINT + BC_SUPPLIER_BANK_CONFIRM)
  WARN  B06  00100241: CompanyCode in ZBR_AP_ACCOUNTANT overridden by ZBR_ANALYTICS_ALL
  FAIL  B07  00100211: needs Advanced, budgeted Core
  FAIL  B07  00100241: needs Advanced, budgeted Core
  WARN  B08  ZBR_PURCH_MANAGER_US: BC_PO_APPROVE_OLD is deprecated, successor BC_PO_APPROVE
  WARN  B09  ZBR_AP_ACCOUNTANT: BC_PAYMENT_RUN in TPL_AP_ACCOUNTANT left out without a reason
  FAIL  B10  ZBR_ANALYTICS_ALL: owner missing
  FAIL  B11  YY1_QUOTECHECK_UI5R: catalog BC_PO_PROCESS and page ZPG_RECEIVING sit in no common role; nobody sees the tile
65 OK, 4 WARN, 10 FAIL (synthetic data)

Only problems are printed; OK lines are counted. The rules:

Rule Checks Grounded in
B01 No SAP template is assigned as it is SAP's training: standard roles not for production
B02 Every role has a space with at least one page SAP's training: at least one space and one page
B03 Write never Unrestricted (FAIL); Read Unrestricted is a WARN SAP's lesson: avoid Unrestricted
B04 Restricted fields have values; Write isn't No Access when a catalog posts SAP's defaults; course rule for the check
B05 No user holds a conflicting pair of catalogs Course pairs, after the roles topic
B06 No restriction is lifted by another of the user's roles SAP's blog on restrictions
B07 A user's catalogs fit the price category finance budgeted Price categories per catalog; plan is course data
B08 No deprecated (WARN) or removed (FAIL) catalog in a role SAP's upgrade blog
B09 Every template catalog left out has a recorded reason SAP's upgrade blog: document deliberate omissions
B10 Every role has an owner Course rule
B11 Every custom tile's catalog and page meet in some role SAP's custom-UI lesson

B00 is not a design rule: it only flags a catalog name the content file doesn't know, which you meet in Step 7.

Step 5: Look at one user, not one role

python unit27/business_roles.py --user 00100241
User 00100241
  ZBR_AP_ACCOUNTANT      BC_SUPINV_PROCESS, BC_PO_DISPLAY
  ZBR_ANALYTICS_ALL      BC_PROC_ANALYTICS
  ZBR_EMPLOYEE           BC_ESS
  Read access by field (all roles together):
    CompanyCode              * (any value)
    Plant                    CP11
    PurchasingOrganization   PUUS
  Price category of the user: Advanced

The AP accountant's own role is restricted to CP10. The "analytics for everyone" role, created without an owner, lifts company code to any value and raises her to the Advanced price category. Neither shows if you read ZBR_AP_ACCOUNTANT alone. Now try --user 00100250: the master data specialist holds both supplier maintenance and bank-change confirmation in one role.

Step 6: Review the corrected design

python unit27/business_roles.py --design reviewed
Rules B01-B11 on the reviewed design
87 OK, 0 WARN, 0 FAIL (synthetic data)

What changed, and why each fix is a design choice rather than a setting:

Draft Reviewed
Template TPL_BUYER assigned, unrestricted ZBR_BUYER_US copied from it, restricted to PUUS/CP11, analytics left out with a reason (Advanced category)
Receiving role with no space, Write No Access Space ZSP_RECEIVING, Write restricted to plant CP11
AP supervisor unrestricted Restricted to both company codes, CP10 and CP20, by name
One role changes and confirms bank data ZBR_MD_STEWARD for 00100262 confirms; the specialist only maintains
Analytics for everyone, no owner ZBR_SPEND_ANALYST for the group controller, owned by 00100280, read only
Custom quote check on the receiving page Placed on ZPG_PURCHASING, in the buyer's space

Run --design reviewed --user 00100241 and compare with Step 5: company code CP10 only, price category Core.

Step 7: Play the upgrade

python unit27/business_roles.py --design reviewed --upgrade
Affected business roles after release 2702 (reviewed):
  ZBR_BUYER_US           Deprecated catalog   BC_PO_DISPLAY: adopt successor BC_PO_DISPLAY_V2
  ZBR_PURCH_MANAGER_US   Deprecated catalog   BC_PO_DISPLAY: adopt successor BC_PO_DISPLAY_V2
  ZBR_RECEIVING_US       Deprecated catalog   BC_PO_DISPLAY: adopt successor BC_PO_DISPLAY_V2
  ZBR_AP_ACCOUNTANT      Deprecated catalog   BC_PO_DISPLAY: adopt successor BC_PO_DISPLAY_V2
  ZBR_AP_ACCOUNTANT      Template change      TPL_AP_ACCOUNTANT now has BC_SUPINV_MONITOR: add it or record why not
  ZBR_AP_SUPERVISOR      Deprecated catalog   BC_PO_DISPLAY: adopt successor BC_PO_DISPLAY_V2
  ZBR_AP_SUPERVISOR      Template change      TPL_AP_ACCOUNTANT now has BC_SUPINV_MONITOR: add it or record why not
7 change(s) to review
Rules B01-B11 on the reviewed design after the upgrade
  WARN  B08  ZBR_AP_ACCOUNTANT: BC_PO_DISPLAY is deprecated, successor BC_PO_DISPLAY_V2
  ...
77 OK, 10 WARN, 0 FAIL (synthetic data)

The middle lines are cut here; you see ten warnings. A design that passed yesterday now carries ten warnings without anyone touching it. That is the six-monthly cycle in miniature. Now adopt SAP's successor, like Adopt Changes:

python unit27/business_roles.py --design reviewed --upgrade --adopt
Adopted 5 successor catalog(s) in roles_reviewed.json
Affected business roles after release 2702 (reviewed):
  ZBR_AP_ACCOUNTANT      Template change      TPL_AP_ACCOUNTANT now has BC_SUPINV_MONITOR: add it or record why not
  ZBR_AP_SUPERVISOR      Template change      TPL_AP_ACCOUNTANT now has BC_SUPINV_MONITOR: add it or record why not
2 change(s) to review
Rules B01-B11 on the reviewed design after the upgrade
  WARN  B09  ZBR_AP_ACCOUNTANT: BC_SUPINV_MONITOR in TPL_AP_ACCOUNTANT left out without a reason
  WARN  B09  ZBR_AP_SUPERVISOR: BC_SUPINV_MONITOR in TPL_AP_ACCOUNTANT left out without a reason
85 OK, 2 WARN, 0 FAIL (synthetic data)

The successor swap is mechanical, so the tool does it. The template change is a decision: should every AP accountant get the new invoice monitor? The exercise makes that call.

If you now run --design reviewed without --upgrade, you get five B00 failures: the roles name a catalog that exists only after the release. That is why the blog does this work in the upgraded tenant, not before it.

Step 8: Save your work in Git

git add unit27/business_roles.py unit27/broles
git commit -m "Unit 27: business roles review and upgrade"

The files hold only made-up data, so they are safe to commit.

How the code works

Part What it does
RESTRICTION_TYPES, CATALOGS, TEMPLATES SAP's side as stand-ins: which fields each type restricts, each catalog's price category, whether it posts, its types and status
CONFLICTS, LICENSE Course conflict pairs and the price category finance budgeted per user
draft(), reviewed() The two designs: roles with catalogs, access categories, values, spaces, owner, users and recorded omissions
RELEASE_2702 The upgrade: new catalogs, a deprecation with successor, a removal, a template addition
load() Reads the files; with --upgrade, applies the release to SAP's side (templates move to successors too)
check() Applies B01 to B11 per role, per user and per custom app
affected() Lists what the release asks of each role, like the Affected Business Roles tab
adopt() Swaps successors into the design file; template additions stay for a person
explain() Combines one user's roles field by field; an unrestricted Read shows as *
selftest() Builds the files in a temporary folder and asserts the planted verdicts

If something goes wrong

What you see What it means What to do
python: command not found or 'python' is not recognized Python isn't on your PATH, or .venv is off Turn on .venv (Step 1); on macOS/Linux try python3
Cannot read ...content.json: run with --init first. The sample files don't exist yet Run python unit27/business_roles.py --init
... already exists; delete it first --init won't overwrite your edits Delete unit27/broles only if you want the sample back
A JSON file is broken An edit left a missing comma or quote Undo the edit; VS Code underlines the broken spot in red
B00 ... unknown catalog BC_PO_DISPLAY_V2 You adopted the release and ran without --upgrade Add --upgrade, or delete unit27/broles and run --init
Counts differ from the steps You edited a file, or ran --adopt already Delete unit27/broles, run --init, follow the steps again
--adopt needs --upgrade Nothing to adopt before the release Add --upgrade
A company laptop blocks scripts in PowerShell Execution policy stops Activate.ps1 Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned, or ask IT

The SAP way

What implements each idea, as SAP's pages described it on 1 December 2026:

Need SAP tool Edition Source
Build and assign roles Maintain Business Roles, Maintain Business Users Public Edition SAP Learning
See catalogs, restriction types, status, successors Business Catalogs, Display Restriction Types, IAM Information System Public Edition SAP Community
Restrict org data Maintain Restrictions, Leading Restriction, mass change Public Edition SAP Learning
Handle an upgrade Manage Business Roles after Upgrade, Business Role Templates (Compare), Adopt Changes, What's New Viewer, SAP Note 2975653 Public Edition SAP Community
Move roles between tenants Export Software Collection Public Edition Same post
Launchpad Manage Launchpad Spaces, Manage Launchpad Pages, Create Spaces Based on SAP-Delivered Spaces Both editions SAP Learning
Custom apps Custom Tiles, Custom Catalog Extensions; developer catalogs in ABAP Development Tools Public Edition SAP Community Q&A
Find a failed check Display Authorization Trace Public Edition SAP Learning
Roles with catalogs and spaces PFCG menu, SU24 defaults, PRGN_COMPARE_ROLE_MENU; SAP_FIORI_CONTENT_ACTIVATION for sandboxes Private Edition, on-premise SAP Learning

Licensing notes. In Public Edition the catalogs in a user's roles set the user's price category; SAP's training points to the service description for pricing. Governance products that analyse or certify roles are licensed separately, as the roles topic noted. Check your own contract; this course has no pricing beyond what SAP's training states.

Build vs. SAP

A team can always write its own checks on top of SAP's apps. The question is which work belongs where.

Need Use SAP's tools Build your own check Why
Create, restrict, assign roles Yes No Only SAP's apps change the tenant
Adopt successors and template changes Yes Report on top Adopt Changes does the swap; a report of decisions helps reviewers
Combined access per user IAM Information System Often A user-level view across roles, with your conflict pairs, is easy to script from exports
Licence check against budget Price category column Often Finance wants it per user against a plan
SoD rules across systems A governance product Rarely The roles topic covers access control tools; a homemade rule set doesn't scale to many systems
Role documentation and owners No dedicated field shown in the pages we read Yes Keep owner, purpose and omissions in a register beside the tenant

Architecture view

Where it sits. Roles live inside each S/4HANA tenant or system. People come from HR through an identity service, which SAP Cloud Identity Services covers; roles are assigned in the system or by a governance tool. Agents and integrations reach the same system with their own users.

flowchart LR
  HR[HR system] --> IDS[Identity service]
  IDS --> S4[S/4HANA tenant<br/>business users]
  GOV[Governance tool] -. role requests, reviews .-> S4
  SAP[SAP content<br/>catalogs, templates] -- upgrade --> S4
  S4 --> FLP[Launchpad<br/>spaces and pages]
  AG[Agents and integrations<br/>own users] --> S4

Non-functional requirements that decide the design.

Requirement Typical target What breaks if it's missed
Least privilege No unrestricted Write in production roles Users change data in company codes they don't own
Licence fit Every user's price category matches the plan Surprise cost at the true-up
Upgrade readiness Affected roles reviewed in the test tenant before production upgrades New apps never reach users; deprecated catalogs pile up
Traceability Owner and reason for every role and omission Nobody can say why a clerk can post invoices
Time to access New joiner productive on day one Shared logons and "borrow my user"

Integration and identity. A person's identity arrives through single sign-on and is a business user with roles in the tenant. Integrations use communication users with their own arrangements, not business roles. An agent acting for a person is bounded by that person's roles, as agent permissions and SAP authorizations set out; its own technical identity gets its own narrow access.

The decision to record.

  • Context: Calder may run part of its business on a cloud edition with SAP-owned catalogs, and today keeps all of CP10 in PFCG roles.
  • Options: (1) assign SAP's templates and fix later; (2) copy templates per job, restrict by org, keep a register of owners and omissions; (3) build every role from scratch from catalogs.
  • Decision: option 2. Templates give SAP's view of a job and a comparison point at each upgrade; the register keeps deliberate differences from being undone.
  • Consequences: a twice-yearly review in the test tenant, owned by the IAM lead with each process owner; finance reviews price categories when a catalog is added.

What a design review will ask.

  1. Which production roles are uncopied templates, and which have unrestricted Write?
  2. Show the combined access of the AP supervisor across both company codes.
  3. Who adopts catalog changes each release, in which tenant, and how long before production upgrades?
  4. Which catalog pairs are never given to one person, and who checks across roles?
  5. How does a custom app reach exactly the people who should see it?

Production concerns

  • Security and authorizations. Review per user, not per role. Remove Unrestricted from Write everywhere; justify Read. Keep one catalog pair list for conflicts and check it at every change.
  • Evaluation. Test each changed role with a test user and the authorization trace before release, as SAP's lessons advise. Keep the test cases with the role.
  • Cost. Record each catalog's price category in the role register. A new catalog in a shared role is a finance decision.
  • Operations. Put the February and August reviews in the release calendar, with owners. Delete unused test roles: SAP's blog found one blocking the removal of a deprecated catalog.
  • Clean core. Don't try to work around SAP's catalogs. Custom apps get developer catalogs or are published into a catalog on purpose; in Private Edition, keep changes to SAP's proposed values small and documented.

Where AI fits

Three places, none of them in SAP's role apps as far as the pages we read show:

  • Agents are users too. An agent that reads purchase orders needs its own narrowly restricted access, and when it acts for a person, that person's combined roles bound it. Design them in the same matrix, as agent permissions and SAP authorizations shows.
  • Reading release changes. A model can summarize SAP's IAM change files for your roles in use and draft the adopt-or-decline list. The decision and the change stay with a person, and the deterministic check (like affected() here) decides what is in scope.
  • Explaining access. "Why can this clerk post in CP20?" is a good question for an assistant grounded on exported roles, if the export itself is access-controlled. Joule's own roles are covered in Joule authorizations and security.

Pitfalls

  • Assigning SAP's templates in production because the go-live date is close.
  • Reviewing roles one at a time and missing that a second role lifts a restriction.
  • Adding an Advanced catalog to a shared role for one person's request.
  • Leaving Write at No Access and logging "authorization error" tickets for weeks.
  • Forgetting the space: the authorization works and the person sees an empty launchpad.
  • Publishing a custom app into a widely held SAP catalog, so far more people see it than intended.
  • Treating the upgrade review as optional until users ask why a new app never arrived.
  • Leaving catalogs out of a role without writing down why, then re-adding them at the next comparison.

Exercise: decide the template change and close the upgrade

Release 2702 added the supplier invoice monitor to SAP's AP accountant template. Calder decides: the AP supervisor gets it; accountants don't, because the supervisor watches the invoice backlog.

  1. Make sure you have run Step 7, including --adopt. Then open unit27/broles/roles_reviewed.json in VS Code.

  2. Find "id": "ZBR_AP_SUPERVISOR". In its "catalogs" list, add "BC_SUPINV_MONITOR" as the last item (mind the comma before it). Save.

  3. Find "id": "ZBR_AP_ACCOUNTANT". In its "omitted" block, add a line "BC_SUPINV_MONITOR": "the supervisor watches the invoice backlog" (again mind the commas). Save.

  4. Run:

    python unit27/business_roles.py --design reviewed --upgrade
    Affected business roles after release 2702 (reviewed):
    0 change(s) to review
    Rules B01-B11 on the reviewed design after the upgrade
    87 OK, 0 WARN, 0 FAIL (synthetic data)
  5. Run python unit27/business_roles.py --design reviewed --upgrade --user 00100244 and check that the supervisor now holds BC_SUPINV_MONITOR and stays at price category Core.

  6. In unit27/notes.md, write three sentences: who at Calder should make this kind of decision, in which tenant, and how the decision survives the next template comparison.

Done when the upgrade run shows 0 change(s) to review and 87 OK, 0 WARN, 0 FAIL, and notes.md holds your three sentences. The access control and identity governance topics, planned in Unit 27, take these roles into a governed request and review process.

Check yourself

Pick one answer for each question. The explanation appears after you choose.

1Why does the lab review users as well as roles?

Answer: A. SAP's blog on restrictions shows an unrestricted field in a second role lifting a restriction. explain() and rules B05 to B07 combine a user's roles, which is how the AP accountant's company code reached any value in the draft.

2The receiving clerk's tile opens but goods receipts fail to post. The role holds the right catalog. What do you check first?

Answer: B. A new role's Write, Read, Value Help category starts at No Access, so the app is authorized but can't change data. Rule B04 catches it; the authorization trace would show the failed check.

3In the lab, why does --adopt swap successors but leave template additions alone?

Answer: D. SAP's blog adopts deprecated catalogs' successors with Adopt Changes, while the template comparison is reviewed and deliberate omissions documented. Giving every accountant a new app is an access decision someone must own.

4A team wants a custom quote-check app visible to buyers only. What does the tile need?

Answer: C. SAP's custom-UI lesson says the app's catalog and the space holding its page must be in the same role. The draft put the tile on the receiving page, so rule B11 found nobody who could see it.

5Can Calder add a field to an SAP restriction type in Public Edition so roles can restrict by purchasing group?

Answer: C. Customers fill SAP's restriction fields with values; they don't change catalogs or their restriction types. A custom app built with developer extensibility can bring its own authorization and catalog.

6After --adopt, running without --upgrade shows B00 failures. What does this tell you about the real process?

Answer: C. The successor exists only after the upgrade. SAP's blog has the test tenant upgraded first and the work done in the development system's customizing tenant, then moved with Export Software Collection.

7In Private Edition, Calder changes SU24 proposals in a copied SAP_BR role. What follows?

Answer: D. PFCG gives freedom to change almost anything, and with it ownership. SAP's lesson points to PRGN_COMPARE_ROLE_MENU and the PFCG comparison when catalogs change.
NextSAP Cloud Identity Services: authentication, provisioning and the identity directoryHow SAP's identity layer signs people in, feeds users and groups from HR to SAP systems, and keeps one directory, and how to design it so leavers lose access.

Sources

Sign in to track your progress

We'll email you a one-time sign-in link. No password needed.

or

Tell us a little about you

Optional, every field. It helps us pitch answers to your questions at the right level and decide which topics to write next. It is never shown publicly, and you can change or clear it anytime from the account menu.

SAP areas you work in