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

has_access_to_entity() breaks when ignoring access #7159

Closed
mrclay opened this issue Aug 13, 2014 · 2 comments
Closed

has_access_to_entity() breaks when ignoring access #7159

mrclay opened this issue Aug 13, 2014 · 2 comments

Comments

@mrclay
Copy link
Member

mrclay commented Aug 13, 2014

This function relies on _elgg_get_access_where_sql() which relies on get_access_array(). Both rely on the global access state. The former can be altered to pass an explicit "ignore_access" option it, but get_access_array() is called by get_access_list(), and there's a nested cache, making it practically impossible to pass the ignore flag into it directly.

So I'm recommending just turning on the access system when building the query in has_access_to_entity().

Long term solution is to allow creating a temporary use query builder that relies on a directly-injected access bit. I.e. no functions that reach out to global access.

@mrclay mrclay added this to the Elgg 1.9.0 milestone Aug 13, 2014
mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Aug 13, 2014
This function relies on a nested stack of functions which all depend
on the global "ignore access" state. This pragmatic workaround ensures
the access system is always enabled while all these functions are called.

Fixes Elgg#7159
@mrclay
Copy link
Member Author

mrclay commented Aug 13, 2014

PR #7160

juho-jaakkola pushed a commit to juho-jaakkola/Elgg that referenced this issue Aug 22, 2014
…o be ignored

This function relies on a nested stack of functions which all depend
on the global "ignore access" state. This pragmatic workaround ensures
the access system is always enabled while all these functions are called.

Fixes Elgg#7159
juho-jaakkola pushed a commit to juho-jaakkola/Elgg that referenced this issue Aug 22, 2014
juho-jaakkola pushed a commit to juho-jaakkola/Elgg that referenced this issue Aug 22, 2014
@juho-jaakkola
Copy link
Member

Fixed in #7172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants