-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw exceptions when permissions checks fail #1828
Conversation
Add and throw missing exceptions when permissions checks fail. This prevents certain operations that the user does not have privileges to perform from succeeding anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make the methods throw the exception themselves? It looks like they are already throwing ThriftSecurityException
.
|
OK I see that now. For example, the Auditing needs to know the result so it can be logged. |
Shouldn't spotbugs have noticed the boolean returned not being used? |
It is my understanding that spotbugs doesn't check the return value of every method, only well-known ones whose return values are expected to be used. It's possible that at level 20, it would report it. However, we run spotbugs at maxRank 16, because higher is too spammy, and the value of what it finds is diminished. |
Don't attempt to flush first when cloning, or the audit log message will show denial on the flush operation, rather than the clone operation being checked.
(cherry-picked for 2.0.1) Add and throw missing exceptions when permissions checks fail. This prevents certain operations that the user does not have privileges to perform from succeeding anyway.
Add and throw missing exceptions when permissions checks fail. This
prevents certain operations that the user does not have privileges to
perform from succeeding anyway.