[MDEV-7887] A role stays default even if it's revoked from the user or even dropped Created: 2015-03-31  Updated: 2016-04-28  Resolved: 2016-04-28

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: 10.1
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None


 Description   

Currently if a role is set as default for a user, and then revoked or dropped, the default setting is preserved; and if the role is later re-created and/or re-granted, it immediately becomes default again. I assume it's because the value is kept in mysql.user.

It's a bit counter-intuitive, not how things are usually done in MySQL when stuff gets dropped. However, it's nor really critical, so if it works so "by design", I don't insist on changing it, please just document it explicitly in the KB.



 Comments   
Comment by Sergei Golubchik [ 2015-03-31 ]

Yes, it was intentional, with the reasoning that only an explicit user action should change his own default role. So, when somebody else revokes something from someone it doesn't change user's personal account preferences. Of course, the role won't longer be automatically enabled, but it will be still remembered as a default.

But this behavior can be changed, so if you want to argue that a role revocation should automatically unset user's default role — please do.

Comment by Elena Stepanova [ 2015-03-31 ]

Well, my argument is just that it was counter-intuitive for me; however, my expectations are not always the same as common users', there can be reasonable explanation for either way, and I don't see any particular danger in the current behavior (apart from maybe a mild surprise for a user, when they used to have a role long time ago, then it was dropped and well-forgotten, then an admin re-created and re-granted it, and suddenly additional permissions appear by default. But it doesn't sound scary.) So I don't insist on changing it, only on updating documentation.

Comment by Ian Gilfillan [ 2016-04-28 ]

It does seem a bit counter-intuitive, especially when it's the same user that set the role as default doing the dropping or revoking. I can picture a situation where a user is surprised by a recreated role being default, but the reverse shouldn't really be surprising. Anyway, it's relatively trivial, and the current behaviour is now documented.

Generated at Thu Feb 08 07:23:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.