Salesforce

How to use the CAN-DO function to implement runtime application security

« Go Back

Information

 
TitleHow to use the CAN-DO function to implement runtime application security
URL NameP27190
Article Number000128631
EnvironmentProgress 9.x
OpenEdge 10.x, 11.x
All Supported Operating Systems
Question/Problem Description
How to use the CAN-DO function to implement runtime application security
What is runtime application security?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
Runtime application security is the process of checking to see if the user requesting to run a piece of code has permissions to do so. If the user is not authorized, the request will be denied.

To establish run-time application security, the developer must set up a permissions table within the database.

The permissions table contains records that specify users who are authorized to run specific procedures. Each record in the permissions table must contain at least two fields: an Activity field and a Can-Run field. The Activity field contains the name of the procedure and the Can-Run field contains a list of the user IDs of those who have permission to run the procedure. Within the application, the developer uses the CAN-DO  function to test whether the current user can run a specific procedure. For example, if the authorized users are stored in a table named "permission", the following code might be used:

DO FOR permission:
FIND permission WHERE Activity = "custedit".
IF NOT CAN-DO(permission.Can-Run, USERID) THEN DO:
MESSAGE "You are not authorized to run this procedure".
RETURN.
END.
END.
 
See the documentation reference below for a more detailed version of this example.

The security administrator must maintain the permissions table. It is the developer's responsibility to provide the tools to maintain the runtime permissions table.
Workaround
Notes

The concept referred to as "runtime application security" in this article should not be confused with the "Use Runtime Permissions Settings" option in the Data Dictionary (character) or Data Administration tool (GUI). "Use Runtime Permissions Settings" applies database security at run-time; that is, it causes the the CAN-* permissions of the database tables and fields to be checked at run time as well as at compile time. See the article reference below for more details.

Reference to Other Documentation:

OpenEdge Development: ABL Reference, "ABL Syntax Reference > CAN-DO Function"

Progress Articles:

"What does selecting the "Use Runtime Permissions Checking" database option mean?"
 

Keyword Phrase
Last Modified Date11/20/2020 7:30 AM

Powered by