在CDS访问控制中使用动态值(Use dynamic values in CDS access control)

编程入门 行业动态 更新时间:2024-10-25 04:23:29
在CDS访问控制中使用动态值(Use dynamic values in CDS access control)

如何将cds元素与ABAP函数的返回值进行比较?

例如:员工被分配到公司,公司有来自客户的订单。 这些订单显示在表格中,员工只能看到他们所在公司的订单。

如果员工A在B公司工作,那么角色将是这样的:

grant select on ConsumptionViewName where company = ‚B‘;

我现在想要使这个硬编码的'B'动态,并且有一个ABAP帮助函数,它返回应该使用的雇员的雇主。 没有任何授权对象有公司的字段,是否可以没有一个?

How can I compare a cds element to a return value of an ABAP function?

As an example: An employee is assigned to a company and the company has orders from customers. These orders are displayed in a table and employees should only see orders for the company they are working for.

If employee A was working for Company B, the role would be something like this:

grant select on ConsumptionViewName where company = ‚B‘;

I now want to make this hardcoded 'B' dynamic and there is an ABAP helper function that returns the employer of an employee which should be used. There aren't any authorization objects that have a field for the company, is it possible to do it without one?

最满意答案

您无法为CDS DCL提供动态值。

如果找不到合适的权限对象,您可以定义自己的权限对象并让DCL完成其工作,也可以通过使用ABAP帮助程序函数过滤结果来过滤网关层的结果。

There is no way you can supply your dynamic values for the CDS DCL.

If no suitable authority object is found, either you define your own one and let DCL do its job. Alternatively you can filter the result at Gateway layer (methods in ...DPC_EXT class) by filtering the result with the ABAP helper function.

更多推荐

company,ABAP,公司,电脑培训,计算机培训,IT培训"/> <meta name="description&q

本文发布于:2023-08-01 17:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1361302.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:访问控制   动态   CDS   dynamic   control

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!