datajoint-python icon indicating copy to clipboard operation
datajoint-python copied to clipboard

show permissions on permission error

Open ixcat opened this issue 5 years ago • 2 comments
trafficstars

it would be nice to show permissions (see: https://github.com/datajoint/datajoint-python/issues/801 for base capability) when users are denied access to something or to reference how to see permissions. A current example:

datajoint.errors.AccessError: ('Insufficient privileges.', "Access denied for user 'admin'@'%' to database 'experimental'", 'CREATE DATABASE `experimental`')

could either leverage #801 directly, or more simply adjust message to point to this capability.

ixcat avatar Jul 11 '20 00:07 ixcat

On a similar note, we just experienced a case where a user did not have REFERENCES privilege for a foreign key in a different schema and DataJoint 'silently' allowed table class declaration though it did not create the table. User had only SELECT privilege. Error was thrown when trying to display from the table (as it did not exist). The reason is because there isn't much clarity on access permissions when there is an error. The mentioned issue here is a direct result of the pass here. Actual PyMySQL error for the case described:

OperationalError(1142, "REFERENCES command denied to user 'mileswells'@'c-98-194-165-64.hsd1.tx.comcast.net' for table 'ibl_acquisition.session'")

guzman-raphael avatar Oct 01 '20 20:10 guzman-raphael

Possibly related to #805

guzman-raphael avatar Jan 15 '21 18:01 guzman-raphael