Using CDS Access control we can restrict data selection access. It allows you to put checks on the data using standard authorization object and limiting values for the same
e.g. This is one of the standard access control for Profit Center
In this blog, we will look at how access control can be used to control UI‑level modifications—for example, managing the visibility of Create, Edit, and Delete options—without the need for additional custom coding.
'02' (change).
When a user with the correct authorization views the CDS data,
User not having authorization for activity will see content as below
...
association[0..1] to ZTEST_BO_AUTH as _BOAuth
on cdsviewname = 'I_PROFITCENTER'
{
...,
_BOAuth
}
isEditable property provided by this child association:{/ZTEST_BO_AUTH('I_ProfitCenter')/isEditable}
Get this entityset loaded at the beginning.
var oModel = this.getView().getModel();
oModel.read("/ZTEST_CBO_AUTH", {
urlParameters: {
"$filter":"BusinessObjectID eq 'I_PROFITCENTER'",
"$orderby":"isEditable desc"
},
success: function (oData) {
if (oData?.results ) {
var bEditable = oData.results[0].isEditable; // boolean conversion
}
When a user without activity '02' opens the app, the Edit button will no longer appear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 30 | |
| 21 | |
| 19 | |
| 16 | |
| 15 | |
| 13 | |
| 13 | |
| 13 | |
| 11 | |
| 10 |