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

2.1.9 upgrade, Projects module shows the number of projects in filter tabs, but "No projects available" to view #56

Closed
cleary opened this issue Feb 27, 2019 · 15 comments

Comments

@cleary
Copy link
Contributor

cleary commented Feb 27, 2019

Hi Adam,
I'm testing the upgrade to v2.1.9 - for all our non-admin users, they are no longer able to get a listing of projects in the Projects module:

screenshot_20190227_110330

The filter tabs indicate correctly how many should be visible.

The permissions/roles haven't changed since our 2.1.8 deployment, and look like this (for this particular example):
screenshot_20190227_110509

screenshot_20190227_110536

The Project Worker role looks like:
screenshot_20190227_110812

Is there something I'm missing that's changed in the role?

@ajdonnison
Copy link
Contributor

ajdonnison commented Feb 27, 2019 via email

@cleary
Copy link
Contributor Author

cleary commented Feb 27, 2019

This is using the docker container config I talked to you about earlier, and pulls the master branch as is - none of the performance enhancements we worked on were included.

@cleary
Copy link
Contributor Author

cleary commented Mar 6, 2019

Hi Adam,
The plot thickens, during the export/import testing I discovered that this is not related to 2.1.9 specifically, it's also affecting the v2.1.8 tag code -
I guess that implies theres a dependency potentially missing, or a bug in the Centos packages I'm using (same as in the docker-compose bundle I sent previously)

@ajdonnison
Copy link
Contributor

So there was an export and import that caused this? It sounds very much like the permissions cache hasn't come across cleanly. In the change from 2.1.3 to 2.1.4 there was a change to speed up permissions handling by creating a permissions cache table and populating it from the phpgacl tables. If you look at db/upgrade_213_to_214.sql you'll see how it was doing that. It may be you need to run a similar query to re-populate the cache.

@cleary
Copy link
Contributor Author

cleary commented Mar 6, 2019

I just did a mysqldump of our live database (our standard backup procedure) and brought that dump into the new db instance - the dump is completely generic, all tables, no trickery.

I grabbed the sql query you mentioned, replaced the %dbprefix% vars appropriately and ran it against my db. I had to re-login, but the issue is still there

@cleary
Copy link
Contributor Author

cleary commented Mar 15, 2019

Hi Adam,
I did a little more attempted debugging today, devel branch using ubuntu 18.04/php 7.2 instead of CentOS - same symptoms.

I've also tried using the official MySQL docker images - 8.0 and 5.7 had compatibility issues, but 5.5 connected, but still exhibited the same issue -

ajdonnison added a commit that referenced this issue Apr 3, 2019
Possible fix for #56 - needs testing
@ajdonnison
Copy link
Contributor

@cleary take a look at this change - it works on my system with your data, my only concern is that it may introduce other subtle permissions bugs, but I believe the ordering should now be valid - if not I suspect we may need to review the permissions cache and how it is being used, and perhaps look for a better way of caching the GACL lookups.

@ajdonnison
Copy link
Contributor

I think there are some unacceptable side-effects of this latest change, I'm going to revert it - just noticed that admin can't see companies, for instance.

ajdonnison added a commit that referenced this issue Apr 3, 2019
ajdonnison added a commit that referenced this issue Apr 3, 2019
Seems it was an unrelated issue with companies drop down.
@ajdonnison
Copy link
Contributor

And I've just reinstated it as the companies issue was nothing to do with permissions - a further fix will follow. From looking at this it does seem to resolve most of the permissions issues. Please give it a try and see how you go.

@cleary
Copy link
Contributor Author

cleary commented Apr 9, 2019

Hi Adam,
Apologies for the late reply - that looks like it's working pretty well at a cursory glance, anything specific I should be looking at to expose possible problems?

@ajdonnison
Copy link
Contributor

I think just look at those things that are related to the permissions you have set up, so for instance try viewing contacts, companies, departments, tasks and see that they align. I suspect that in the long run we may want to look at a better caching mechanism, as that does have a lot of overhead - every time you update any permission it completely rebuilds the permissions cache, and I don't think that will scale.

@cleary
Copy link
Contributor Author

cleary commented Apr 9, 2019

Yeah ok, straight off the bat, a regular user is getting too much access in Companies - this then gives access to all Company Projects, and I can edit them(!).
Screenshot below, top is the current devel branch, bottom is our production build - the user has not been given access to the "DBW - IT" Company:

Screenshot_20190409_152636

...and edit access to a "DBW - IT" (Company) project.
Screenshot_20190409_152848

I can access Tasks from Companies I don't have access to via the Tasks module:
Screenshot_20190409_153328

Also in Project Designer dropdowns, all Projects are available -

@ajdonnison
Copy link
Contributor

That isn't great. Back to the drawing board then.

ajdonnison added a commit that referenced this issue Apr 28, 2019
@ajdonnison
Copy link
Contributor

@cleary I've just reviewed both the original code, the code on your installation, and the changes I made and realised that the changes on your installation actually make sense, while the original code could never work. I've committed that change so it should now be the same as your running install.

@cleary
Copy link
Contributor Author

cleary commented Apr 29, 2019

Thanks Adam, gave it a test and it's working now

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

No branches or pull requests

2 participants