Skip to content

Lesson 15 Practice — Secure the Support Issue Business Object ​

You already built a state-aware Support Issue BO.

Current flow:

text
O = Open
I = In Progress
C = Closed

Actions:

text
startProcessing
close

Now secure it.

Target architecture:

text
User
 ↓
CDS DCL
 ↓
ZR_ISSUE_###
 ↓
RAP Authorization
 ├─ Global
 └─ Instance
 ↓
Managed Behavior
 ↓
ZISSUE_###

Practice information ​

TimeAbout 3 hours
PrerequisiteLesson 15 teacher-led work
Business ObjectZR_ISSUE_###
Behavior PoolZBP_R_ISSUE_###
Test classZCL_ISSUE_AUTH_###
New fieldResponsibleUser
New objectCDS Access Control

1. Verify the starting point ​

Confirm these activate:

text
ZISSUE_###
ZR_ISSUE_###
Behavior Definition
ZBP_R_ISSUE_###
ZCL_ISSUE_ACTIONS_###

Your BO should already include:

text
managed CRUD
managed UUID numbering
determination
validations
messages
actions
feature control

2. Authorization requirements ​

Implement:

text
Read:
only rows whose ResponsibleUser = current user

Global create/update/delete:
allowed in the Trial exercise

Instance update:
allowed only for ResponsibleUser

Action authorization:
reuse update authorization

Delete:
allowed for classroom cleanup

3. Add persistence ownership ​

Add:

text
responsible_user

to:

text
ZISSUE_###

Use:

text
ABP_CREATION_USER

or the equivalent source type used in the guided lesson.

Keep it nullable.

Explain why that matters for rows created before Lesson 15.


4. Extend the root CDS ​

Expose:

text
ResponsibleUser

Change:

text
@AccessControl.authorizationCheck: #NOT_REQUIRED

to:

text
@AccessControl.authorizationCheck: #CHECK

Activate.


5. Create CDS Access Control ​

Create an Access Control object for:

text
ZR_ISSUE_###

Requirements:

text
@MappingRole: true
define role
grant select on ZR_ISSUE_###
ResponsibleUser = aspect user

Do not hard-code a user.


6. DCL reasoning ​

Answer:

Does the DCL delete unauthorized Issues? ​

Does DCL replace RAP update authorization? ​

Does define role mean the same thing as a PFCG/business role? ​


7. Change RAP authorization ​

Replace:

text
authorization master ( none )

with:

text
authorization master ( global, instance )

Use:

text
Ctrl+F2

before continuing.


8. Update persistence mapping ​

Map:

text
ResponsibleUser

to:

text
responsible_user

9. Protect ResponsibleUser ​

Make:

text
ResponsibleUser

read-only on update.

It must remain writable during create for this exercise.


10. Protect Status if required ​

If a normal external consumer can still directly update:

text
Status

make it read-only.

Status should be controlled by:

text
initial Status determination
startProcessing
close

11. Delegate action authorization ​

Modify:

text
startProcessing
close

so both delegate authorization to:

text
update

Keep their existing:

text
features : instance

logic.


12. Generate authorization methods ​

Use:

text
Ctrl+1

Generate:

text
get_global_authorizations
get_instance_authorizations

Prefer ADT-generated signatures.


13. Implement global authorization ​

For the Trial exercise:

text
requested create
→ auth-allowed

requested update
→ auth-allowed

requested delete
→ auth-allowed

Use authorization constants.

Do not use:

text
fc-o-enabled

here.


14. Explain the global Trial simplification ​

Write one sentence explaining why:

text
allow-all global authorization

is not a production authorization model.

Mention:

text
authorization objects
business roles

15. Implement instance authorization ​

Read:

text
ResponsibleUser

using:

text
READ ENTITIES ... IN LOCAL MODE

Rule:

text
ResponsibleUser = current technical user
→ update allowed

otherwise
→ update unauthorized

For this practice:

text
delete
→ allowed

16. Obtain the current user ​

Use the same ABAP Cloud API as the guided lesson:

text
CL_ABAP_CONTEXT_INFO

and its technical-user getter.

Store the result in a compatible user variable.


17. Report an authorization message ​

For unauthorized update, report a message equivalent to:

text
You are not responsible for this issue

The authorization result must still be:

text
auth-unauthorized

A message is not the decision itself.


18. Activate all changed objects ​

Activate:

text
ZISSUE_###
ZR_ISSUE_###
Access Control
Behavior Definition
ZBP_R_ISSUE_###

Do not create the runtime consumer until everything activates cleanly.


19. Create the test class ​

Create:

text
ZCL_ISSUE_AUTH_###

Implement:

text
IF_OO_ADT_CLASSRUN

This is an external consumer.

It must not use:

text
IN LOCAL MODE

20. Reserved Issue numbers ​

Use:

text
99010001
99010002

Meaning:

text
99010001
→ owned by current user

99010002
→ ResponsibleUser initial

Use valid values so all Lesson 13 validations pass.


21. Repeatable reset ​

Because DCL will hide one test row, use the guided reset approach:

text
read UUIDs for exactly 99010001 / 99010002
delete those UUIDs through EML
commit

Do not use direct SQL writes.


22. Display current user ​

Output the current technical user at the beginning of the test.

Record:

text
Current user:
____________________

23. Create owned Issue ​

Create:

text
IssueNo         = 99010001
ResponsibleUser = current user
Status          = omitted

Expected determination:

text
Status = O

Save its generated UUID.


24. Create unassigned Issue ​

Create:

text
IssueNo         = 99010002
ResponsibleUser = initial
Status          = omitted

Expected:

text
Status = O

Save its generated UUID before commit.


25. Commit both creates ​

Inspect:

text
MAPPED
FAILED
REPORTED

Both create requests should save successfully in the training global-authorization model.


26. Prove DCL filtering ​

Open:

text
ZR_ISSUE_###

with:

text
F8

Expected:

text
99010001 visible
99010002 hidden

Then open:

text
ZISSUE_###

with:

text
Alt+F8

Expected:

text
both physical rows exist

Explain why.


27. Test global authorization ​

Build a permission request for:

text
create
update
delete

Run:

text
GET PERMISSIONS ONLY GLOBAL AUTHORIZATION

Record:

text
create:
update:
delete:

28. Test owned instance authorization ​

Request:

text
update
delete

for:

text
99010001 UUID

using:

text
GET PERMISSIONS ONLY INSTANCE AUTHORIZATION

Expected:

text
update allowed
delete allowed

29. Test unassigned instance authorization ​

Repeat for:

text
99010002 UUID

Expected:

text
update unauthorized
delete allowed

30. Compare feature control with authorization ​

For unassigned Issue:

text
Status = O

Lesson 14 feature control should say:

text
startProcessing enabled

But authorization says:

text
update unauthorized

Record:

text
Feature result:
____________________

Authorization result:
____________________

31. Owned action test ​

Execute:

text
startProcessing

for owned Issue.

Expected:

text
O → I

Commit.


32. Unauthorized action test ​

Execute:

text
startProcessing

for the unassigned Issue using its known UUID.

Expected:

text
action denied
Status remains O
authorization message returned

Explain why this happens even though state-based feature control enables the action.


33. Unauthorized update test ​

Attempt:

text
Notes = 'Should not persist'

on the unassigned Issue.

Expected:

text
update denied
Notes unchanged

Inspect RAP responses.


34. Owned close test ​

For the owned Issue now in:

text
I

execute:

text
close

Expected:

text
I → C

Commit.


35. Cleanup the unassigned Issue ​

Delete it using its known UUID through EML.

Because delete is deliberately allowed for training cleanup, the delete should succeed.

Commit.


36. Final visible state ​

Root CDS should show:

text
99010001
Status = C
ResponsibleUser = current user

The unassigned test row should be gone after cleanup.


37. Repair exercise — wrong access annotation ​

Temporarily reason about leaving:

text
#NOT_REQUIRED

after creating the DCL.

Restore:

text
#CHECK

Explain the intended difference.


38. Repair exercise — missing @MappingRole ​

Inspect what happens if the DCL source is incomplete.

Restore:

text
@MappingRole: true

Explain its purpose.


39. Repair exercise — hard-coded user ​

Wrong:

text
ResponsibleUser = 'MYUSER'

Correct concept:

text
ResponsibleUser = aspect user

Explain why hard-coded identity is not a scalable authorization design.


40. Repair exercise — wrong constant family ​

Wrong:

text
fc-o-disabled

Correct authorization result:

text
auth-unauthorized

Explain:

text
feature availability
vs
user authorization

41. Repair exercise — IN LOCAL MODE in consumer ​

Search:

text
ZCL_ISSUE_AUTH_###

It should not contain:

text
IN LOCAL MODE

Explain why the Behavior Pool may use it but the consumer may not.


42. Repair exercise — DCL only ​

Imagine you keep DCL but remove RAP authorization.

Explain why read filtering alone is not a complete write-protection strategy.

Use:

text
read
update
action

in your explanation.


43. Certification-style mini task ​

Temporarily change the Issue authorization policy so:

text
delete

is also owner-only.

Requirements:

text
check requested delete authorization
compare ResponsibleUser with current user
return auth-allowed or auth-unauthorized
test owned permission
test unassigned permission

Restore delete-allowed behavior afterward if you still need repeatable classroom cleanup.


44. Certification knowledge — PFCG ​

Research only:

text
aspect pfcg_auth
AUTHORITY-CHECK
ACTVT

Answer:

Which mechanism belongs in CDS DCL? ​

Which mechanism can appear inside RAP authorization implementation? ​

Why does this Trial lesson not create a complete custom PFCG authorization lifecycle? ​


45. Authorization audit ​

Complete:

ConcernMechanismResult
Owned Issue visible
Unassigned Issue hidden
Global create
Owned update
Unassigned update
Owned startProcessing
Unassigned startProcessing
Delete cleanup

46. Feature vs authorization audit ​

Complete:

InstanceStatusAction featureUpdate authorizationFinal action result
OwnedO before action
UnassignedO

Explain why the unassigned row can have:

text
enabled feature
+
unauthorized operation

47. Submission checklist ​


48. End-of-practice explanation ​

Explain without notes:

text
DCL protects reads.

Global RAP authorization answers whether
the user may perform an operation generally.

Instance RAP authorization adds
instance-dependent user permission.

Feature control is not authorization.

A feature can be enabled while
authorization still denies execution.

IN LOCAL MODE belongs to provider logic,
not external consumers.

If you can prove those statements in your own Issue BO, you are ready for Lesson 16.