Skip to content
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

Call access control once per check #15131

Conversation

kokosing
Copy link
Member

Call access control once per check

Calling access check multiple times per same element not only
needs more time to execute query but also may pollute audit information.

@cla-bot cla-bot bot added the cla-signed label Nov 21, 2022
@kokosing kokosing force-pushed the origin/master/160_cache_access_control branch from bcddf1a to 9d1413e Compare November 21, 2022 16:07
@kokosing
Copy link
Member Author

This is just an idea for discussion

@kokosing kokosing force-pushed the origin/master/160_cache_access_control branch from 9d1413e to 6dc574f Compare November 21, 2022 21:09
Calling access check multiple times per same element not only
needs more time to execute query but also may pollute audit information.
@kokosing kokosing force-pushed the origin/master/160_cache_access_control branch from 6dc574f to 51df95b Compare November 22, 2022 13:15
this.accessControl = requireNonNull(accessControl, "accessControl is null");
this.accessControl = newProxy(
AccessControl.class,
new OnlyOneInvocationHandler(requireNonNull(accessControl, "accessControl is null")));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be explicit Map here in this class?

@findepi
Copy link
Member

findepi commented Nov 22, 2022

What's the example query where this would be beneficial?

@findepi
Copy link
Member

findepi commented Nov 22, 2022

BTW overall it makes sense to me.

@dain
Copy link
Member

dain commented Nov 28, 2022

IMO, using reflection to override behavior is not a very sustainable design. In this case, I have no idea what would happen in a multi-threaded environment. If this is a behavior we want then we should add this behavior to the access control manager... but I'd have to think about if we want to handle caching here or in another layer.

@findepi
Copy link
Member

findepi commented Nov 28, 2022

IMO, using reflection to override behavior is not a very sustainable design

i think similar (#15131 (comment))

@kokosing
Copy link
Member Author

I agree, about not using reflections.

Also this PR requires #15111 (proper hashCode and equals for Identity)

@kokosing kokosing closed this Feb 20, 2023
@kokosing kokosing deleted the origin/master/160_cache_access_control branch February 20, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants