Is there any way to check if the user connected to MySQL has update access to a specific table field?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
gandalf1024
Posts: 7
Joined: Wed 04 Apr 2007 07:50
Location: Athens, Greece

Is there any way to check if the user connected to MySQL has update access to a specific table field?

Post by gandalf1024 » Tue 24 Apr 2007 10:30

Hi,

I have some users that don't want them to be able to update specific fields in a table. I have given MySQL restrictions on certain table fields for these users, so that my application raises an exception whenever a user tries to change these protected fields.
Is there however, any way that MyDAC will check for update access on these fields and react accordingly, not letting the user change the field - before sending the update query to the database?
Or, can I check programmatically for the access restrictions for the current user and be able to mark the field readonly at runtime so that the user is not able to change the - for example - checkbox?

Thanx in advance,
Kostas

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 25 Apr 2007 10:16

MyDAC does not support such fuctionality. Try to implement it using MySQL server facility.

EdderU2RSE
Posts: 10
Joined: Tue 17 Apr 2007 19:47

Post by EdderU2RSE » Wed 25 Apr 2007 13:43

I think you must create user with differents actions:
Read, Write, Read-Write, Exe
RWX

gandalf1024
Posts: 7
Joined: Wed 04 Apr 2007 07:50
Location: Athens, Greece

Post by gandalf1024 » Thu 26 Apr 2007 14:52

Ok, I found that I can easily search the information_schema DB for the info that is needed to implement read-only fields inside the application.

Thanx anyway :)

Post Reply