Page 1 of 1
Get user roles
Posted: Thu 12 Dec 2019 06:36
by GaryShelton
How can I get the user's roles? I need to adjust the Select statements, as well as visibility properties for Vcl Form components for MariaDB depending on the users roles. MariaDB does not allow Select * when not all columns have select privileges. Or is there another way this is usually handled?
Re: Get user roles
Posted: Thu 12 Dec 2019 12:38
by ViktorV
You can find the necessary information on getting get user roles by the link
https://dev.mysql.com/doc/refman/8.0/en ... rants.html
Re: Get user roles
Posted: Thu 12 Dec 2019 13:49
by GaryShelton
Sorry, question was not clear enough. Yes I can use the Show Grants statement, but what I am looking for is a way to do this in Delphi code. Something like if User.HasRole('Financial') then change select statement and set visibility for controls based on return value
Re: Get user roles
Posted: Fri 13 Dec 2019 10:12
by ViktorV
MyDAC components don't have those properties. You may try implementing the required functionality yourself, for example, by sending requests to MySQL server and handling the response.