SAP C4C基于自定义BO开发的OWL UI,如何实现动态访问控制-阿里云开发者社区

开发者社区> jerrywangsap> 正文

SAP C4C基于自定义BO开发的OWL UI,如何实现动态访问控制

简介: SAP C4C基于自定义BO开发的OWL UI,如何实现动态访问控制
+关注继续查看

My series of Cloud Application Studio Blogs

How to detect EditMode in an Embedded Component

Step by step to enable your custom BO with attachment upload functionality

Step by step to create an Adobe Print form in Cloud application Studio

How to render PDF which displays picture from the image attachment of your custom BO

How to get current logged on business user’s employee information and assigned organization unit via ABSL

How to implement dynamic access control based on custom BO using OWL

How to make Code List Restriction work when control field and restricted field are not on the same BO

How to implement custom number range using custom business object

Two approaches to create Code List in Cloud Studio

Create Dynamic Code List via Custom Business Object Association

Step by step to develop Thing Type based navigation and BO Object based navigation

Put Extension field into embedded component and make it visible in Standard UI

One possible cause that embedded component fails to display in UI

Step by step to create HTML Mashup and make it visible in UI

Step by step to enable Text Collection for your custom BO

Automatically send an Email notification to line manager via Workflow in Account application

Step by step to create Object Value Selector in Cloud Application Studio

Two approaches to fill an UI field with dedicated logic implemented in Cloud Application Studio

How to execute BO action on multiple selected BO instances in AdvancedListPane

How to add custom validation logic on mobile phone field in Contact TI

Suppose I have a testBO with the following fields:


image.png

And here is some test data displayed in OWL:


image.png


Now I would like to achieve the dynamic access control below:

Suppose the currently logged on user has been assigned to an organization unit which is only allowed to sell product with name “Laptop”, then this business user SHOULD ONLY see those entries whose value in ProductName equals to Laptop as well. That is to say, the last two entries in above picture with ProductName Monitor should be filtered out.


How the restriction that only Laptop is allowed to sell for employees within a given Organization Unit

For demonstration purpose I just reuse the standard field “Department Name” to store the name of sellable product.


image.png


And I assign myself to this organization unit, which means Employee Jerry Wang is only allowed to sell Laptop.


Now I implement this dynamic access control into a new OWL named TestBORestricted_OWL.


Below is the achievement: I have put this new OWL into a new tab in Thing Inspector and once launched, only entries whose ProductName equal to Laptop are displayed. Other entries are filtered out due to the fact that this employee is not allowed to sell them.


image.png


Implementation Detail

Here below is step by step implementation detail:

(1) Create an AfterLoading event in TestBO with mass enabled checkbox unselected,


image.png


And implement the following ABSL code to fill the transient field with product name which is allowed to sell for current logged on user.

image.png

(2) In new TestBORestricted_OWL, create a new field ProductName under search structure SearchParameters.


image.png


Bind the query to QueryByElements modelled in TestBO and bind the query parameter ProductName to the field ProductName under SearchParameters.


image.png


Create a new inport and bind the parameter to the field mentioned above as well.


image.png


(3) Create a new outport in Thing Inspector, bind the parameter productName with the transient field DepartmentName filled in step 1.

image.png



Create a new tab in Thing Inspector and drag the new OWL into it. Click Bind button:

image.png



Bind the parameter of outport defined in TI with the one in inport of new OWL.


With all the steps above done, the sellable product name calculated by ABSL is passed from TI to new OWL via parameter passing during navigation, and could be considered during the query of new OWL is executed. As a result the restriction takes effect due to this ProductName search parameter.


image.png

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
《Android自定义控件开发入门与实战》| 每日读本书
从动画、绘图、视图三方面介绍Android自定义控件相关知识,配以详实的案例讲解每个知识点,既适合系统学习,又可以用于查漏补缺。每日搜罗最具权威专业书籍,更多图书请关注“每日读本书”。
1231 0
在 Visual C++ 中开发自定义的绘图控件
本文讨论的重点介于两者 之间 — 公共控件赋予您想要的大部分功能,但控件的外观并不是您想要的。例如,列表视图控件提供在许多视图风格中显示数据列表的方式 — 小图标、大图标、列表和详细列表(报告)。然而,如果您想要一个网格控件,那结果怎样呢?尽管公共控件库里没有特别包含网格,但是列表视图控件与它较为接 近,它以行和列显示数据,并有一个相关的标头控件。
932 0
Android开发之自定义Spinner
自定义Spinner,需要定制的有默认背景、按下背景,显示时每一项的样式以及弹出时每一项的样式四个方面。下面举个简单例子。 1、准备两张图片,处理为.9png,分别为spinner.
860 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
10277 0
基于AGS JS开发自定义贴图图层
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.前言 假设一个景区有多张图片需要在地图上展示,并且随着地图的缩放而缩放(不是单纯的以气泡来展示)。
697 0
Flex自定义组件开发之日周月日期选择日历控件
原文:Flex自定义组件开发之日周月日期选择日历控件           使用过DateField的我们都知道,DateField 控件是用于显示日期的文本字段,字段右侧带有日历图标。当用户在控件边框内的任一位置单击时,将弹出一个 DateChooser 控件,显示当月的所有日期。
993 0
+关注
2628
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载