Hi,
I want to restrict the creation of entities in my CDS service. Only users who are assigned to the 'create' scope should be able to insert a new record. I want the '+' Button in the ListView to be disabled or invisible.
I annotated my entity as follows (according to this documentation https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.m...😞
entity BusinessPartnerGroup @(
Capabilities:{
InsertRestrictions:{Insertable: true, Permissions:[{Scopes:[{Scope:'create'}]}]},
UpdateRestrictions:{Updatable: true},
DeleteRestrictions:{Deletable: false}},
restrict:[...])as projection on ds.BusinessPartnerGroup {
In the UI the '+' Button is visible although the user is not assigned to the 'create' scope. Here is an excerpt of the request scopes which I analyzed with debugger.
req.attr.scopes
(8) ['read', 'approve', 'openid', 'any', 'authenticated-user', 'identified-user', 'openid', 'openid']
0:'read'
1:'approve'
2:'openid'
3:'any'
4:'authenticated-user'
5:'identified-user'
6:'openid'
7:'openid'
length:
What is the "SchemeName" in the PermissionType good for? I know an OAuth GrantType, an Authentication scheme and an OData Schema. Which one do I have to use here, if any?

Thanks in advance
Helmut
Request clarification before answering.
In the SAP Incident 401125 / 2020 that I've raided I got only directed to the page: What's New in SAPUI5 1.76 with the section:
Path Support for Insert Restriction
We now provide dynamic value support for Capabilities.InsertRestriction/Insert by path evaluation in List Reports and Object Pages. For more information, see Defining and Adapting Sections.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Helmut
I had a similar problem and I temporarily solved it with following workaround: I created a separate CDS service for those entities and then restricted read/write on Service level..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.