Consultor Eletrônico



Kbase P123211: Is there a way to suppress error (234) when user tries to access a table without the required access
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/09/2009
Status: Verified

GOAL:

Is there a way to suppress error (234) when user tries to access a table without the required access privilege ?

GOAL:

How to prevent error: " ** Insufficient access privilege for table customer. (234) " from being generated at runtime?

GOAL:

How to enforce runtime table CREATE access privilege using 4GL code?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

Error (234) is generated when a user runs or compiles 4GL code that accesses a table without the user having the required access privilege. Progress enforces compile time data security but not runtime data security. That means if a user with the required access privileges compiles a piece of code that creates records in a table, then, any user can run that code and create records in that table even when that user lacks the CREATE access privilege for that table. This is so unless the developer builds the runtime security checks in the code itself.
It is the developer's responsibility to check and enforce runtime security and take appropriate action to ensure that only authorized users perform specific functions on the data and to prevent error (234).
For example, if a user with the CREATE access privilege to the Customer table compiles the following 4GL snippet, then, at RUNTIME, the USERID will be checked, the CREATE access privilege for the table will be enforced and the possibility of error (234) will be eliminated:
FIND FIRST _File WHERE _File-Name = "Customer".
IF CAN-DO(_File._Can-Create, USERID) THEN
CREATE Customer NO-ERROR.
ELSE
MESSAGE "Insufficient access privilege to CREATE records in this table!"
VIEW-AS ALERT-BOX INFO BUTTONS OK.