How to retrieve user access rights with FireDAC

73 views Asked by At

I am using FireDAC to access a MySQL database from within Delphi. When logging in into the database I give in the database user name, which is defined within MySQL and has certain access right. How can I retrieve the access rights for this user from within Delphi/FireDAC? I want to make the menus tailored for the given rights. Now my application always allows a user to edit data where that user has no update rights. Then an exception is raised. But the user shouldn’t be allowed to edit in the first place.

1

There are 1 answers

3
mjn On

The SQL statement to see the access rights for the current user is

SHOW GRANTS FOR CURRENT_USER;

however this is not supported by FireDAC.

https://dev.mysql.com/doc/refman/8.0/en/show-grants.html