Joe Meyer
Joe Meyer

Reputation: 4405

How do I find user permissions for a progress database

What is the best method for listing users and getting their associated table permissions for a progress database?

Upvotes: 1

Views: 5029

Answers (4)

RonaldB
RonaldB

Reputation: 1190

This will give you a list of users and the rights they have on each table in the current database:

FOR EACH _user
    NO-LOCK:
    DISPLAY
        _User._Userid
        _User._User-name.
    FOR EACH _File
        WHERE _File._Hidden = FALSE
        NO-LOCK:
        DISPLAY
            _File._file-name FORMAT "x(20)"
            CAN-DO(_File._can-read,_User._userid)
                FORMAT "Y/N" COLUMN-LABEL "Read"
            CAN-DO(_File._can-write,_User._userid)
                FORMAT "Y/N" COLUMN-LABEL "Write"
            CAN-DO(_File._can-create,_User._userid)
                FORMAT "Y/N" COLUMN-LABEL "Create"
            CAN-DO(_File._can-delete,_User._userid)
                FORMAT "Y/N" COLUMN-LABEL "Delete"
            .
    END.
END.

This report will get big very quickly, depending on the number of users and tables in your database.

Upvotes: 0

Tom Bascom
Tom Bascom

Reputation: 14020

The permissions for the 4GL engine and SQL-92 engines are handled somewhat differently.

From the 4GL perspective you want to look at the _User table to find users. I.e.:

for each _user no-lock:
  display _user.
end.

To see table permissions you look at the CAN-* fields of tables:

for each _file no-lock where _hidden = no:
  display
    _file-name
    _can-read
    _can-write
    _can-create
    _can-delete
  .
end.

The docs that Tim points to have lots more detail.

Upvotes: 2

Tim Kuehn
Tim Kuehn

Reputation: 3251

Users are stored in the _user table. You can see more on how Progress does security and identity management by consulting their Identity and Security Docs here: http://communities.progress.com/pcom/docs/DOC-107735

Upvotes: 0

Joe Meyer
Joe Meyer

Reputation: 4405

I ended up writing a quick sql query against my odbc for this for auditing purposes.

SELECT * FROM sysprogress.systabauth ORDER BY grantee, tbl

It also looks like there are a couple of stored procedures (at least in our environment) which may get you what you need:

SQL_TABLE_PRIVILEGES
SQL_TABLE_PRIVILEGES2X

Upvotes: 1

Related Questions