Consultor Eletrônico



Kbase 21806: How To Check Data Security Permissions Within Applications
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   19/02/2002
SUMMARY:

This Solution explains how to check data security permissions and reveals where that information is stored in the database schema.

EXPLANATION:

Data security is available at both the file and field level.
For a file, the _file schema table keeps the permissions in the
following fields:

_Can-Read
_Can-Write
_Can-Create
_Can-Delete
_Can-dump
_Can-load

At the field level, the _field schema table has these fields:

_Can-Read
_Can-Write

The field names themselves make the type of data security permission self-explanatory.

SOLUTION:

This example demonstrates how to check read permissions for the customer table:

FIND _file WHERE _file._file-name = "customer" NO-LOCK NO-ERROR.
IF CAN-DO( _file._Can-Read, USERID ) THEN
DO:
/* OK, you have permissions to read */
END.
ELSE DO:
/* Sorry, I cannot let you read from "customer" */
END.