In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "how to create access control in SAP Cloud for Customer custom BO". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to create access control in SAP Cloud for Customer custom BO.
1. There are two ways of access control in C4C.
RelevantForAccessControl
AccessControlContext
two。 To use access control, the following conditions must be met
For each business object (BO), there can be only one access control.
The source node associated with it must be the Root node of the business object (BO)
For RelevantForAccessControl, the node it is associated with must also be the root node (Root).
For RelevantForAccessControl, the node with which it is associated must have access control. To view the method, you can go to Repository Explorer in studio and click on the object to view. View it in Supported Access Contexts in the business object (BO) document.
For AccessControlContext., it does access control through UUID, so the defined elements must be related to UUID.
How to create BO we no longer discuss here, this article focuses on the operation principle of control in C 4 C.
Syntax 1. RelevantForAccessControl
The grammar of this keyword is
[RelevantForAccessControl] association toBusinessPartner toBusinessPartner; 2. AccessControlContext
The grammar of this keyword is
[AccessControlContext (Employee)] element UID: UUID; [AccessControlContext (Employee)] association ToEmployee to AP.FO.BusinessPartner.Global:Employee using UUID; create access control
Let's take AccessControlContext as an example to see how C 4 C access control works.
The first step is to add an access control field to the BO we created
[AccessControlContext (SalesOrganization)] association toOrganisationalUnit toOrganisationalUnit using UUID
Add the value of the above access control field to the BeforeSave.
Activate and generate the screen
Step two.. Open the WCView screen file and open the properties panel
Change the AccessContextCode property to 9001-PDI:SalesOrganisation
This step is very important and must be the access control code corresponding to the access control field
The following is a table of access control fields and access control codes collected by individuals
If this step is set incorrectly, the access control will not take effect. I will talk about it later.
The third step. Change access to subscreens included under WCView, for example (QC,OWL,TI)
Open the Access Controlled Business Object in it
Set Unrestricted Access to False
This step is also very important. If Unrestricted Access is not set to False, the fields on the screen will not inherit the access control properties set in WCView.
Step four. Change the Query in the OWL page to bind the Query with SAP_AccessControlList
Either QueryByElements or custom Query is fine.
After the above deployment, the system can make the access control effective, and then the thing to do is to assign the WCView to the role, and then set the access control permissions.
How access control works
After we have created the access control field in Business Object and activated it
The system will add a new Dependent Node to the BO
The AccessControlList contains the following fields
The image above is from the SAP community blog Implementing Access Control on Custom Business Objects.
The two most important fields are ACCESS_CONTEXT_CODE and OBJECT_UUID-CONTENT
The access control code of the BO data is stored in ACCESS_CONTEXT_CODE.
The access control content of the BO data is stored in OBJECT_UUID-CONTENT.
When we save, the associated value in AccessControlContext is populated, then the UUID value in the association is saved to OBJECT_UUID-CONTENT in SAP_AccessControlList, and the object in parentheses in AccessControlContext is converted into CODE and stored in ACCESS_CONTEXT_CODE in SAP_AccessControlList.
The converted CODE is converted according to the values in the table above. Therefore, the AccessContextCode value in the WCView of part II cannot be randomly selected. Otherwise, access control will not take effect.
When we assign access rights to users in the system, the system generates a table for each user to access each business object
Only when the data in the user's access rights matches the OBJECT_UUID-CONTENT in the SAP_AccessControlList in BO, the user can see the data.
Tips 1
If we create multiple access control fields in the system, the system will only use the last access control field
For example, there are two access control fields, one is Employee (1010) and the other is SalesOrganisation (9001). When there are multiple access control fields, the system will only focus on the last access control field.
Tips 2
Don't forget to set up other relevant screens (QC,TI,QAF,OWL), otherwise these screens will not be affected by the access control fields and will see all the data in the system.
Tips 3
Suppose that after changing the access control type, the previously set access control field is not affected by the new access control type. The solution is to change any data in the data before the change, and then save it.
Tips 4
The PDI USER account is a magic account, and it is the only account that will not be affected by ACL, so if you encounter some problems with ACL, try using PDI USER to test it.
At this point, I believe you have a deeper understanding of "how to create access control in SAP Cloud for Customer custom BO". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.