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

Saving the permission matrix of roles is not properly working #881

Closed
marvin-w opened this issue Sep 22, 2019 · 12 comments
Closed

Saving the permission matrix of roles is not properly working #881

marvin-w opened this issue Sep 22, 2019 · 12 comments
Assignees
Labels
Milestone

Comments

@marvin-w
Copy link

Gentics Mesh Version, operating system, or hardware.

  • v0.40.3

Operating System

  • Linux (Docker-compose from website)

Problem

Whenever I update the permission of my roles and refresh the page they automatically get dumped and everything is empty again.

Reproducer

Expected behaviour and actual behaviour

Expected

When I update the permissions of a role the view should reflect those changes and save the permissions to the store.

Actual

After a refresh the whole permission matrix is empty again and you need to set everything again.

I'm unsure whether the changes have actually been saved.

@cschockaert
Copy link

+1 very annoying issue for us too.

@Jotschi Jotschi added the UI label Sep 23, 2019
@marvin-w
Copy link
Author

Not sure if its relevant, but I've changed the language to "de" only. So there is no more "en" for me as this is the only language we're supporting right now.

However, by judging the logs it appears that the node has been saved with the "-en" postfix.

09:55:09.046 [] INFO [vert.x-eventloop-thread-6] [i.v.e.w.h.i.LoggerHandlerImpl] - 172.23.0.1 - GET /api/v2/kartigami/nodes/dbab36c7e8e2441aab36c7e8e2c41a54?lang=de&role=36a6d214ab51409ba6d214ab51f09b39 HTTP/1.0 304 0 - 3 ms 09:55:09.081 [] INFO [vert.x-worker-thread-16] [i.v.e.w.h.i.LoggerHandlerImpl] - 172.23.0.1 - GET /api/v2/roles/36a6d214ab51409ba6d214ab51f09b39/permissions/projects/7780ae3334f8428b80ae3334f8728bd8/tagFamilies?lang=de HTTP/1.0 200 128 - 2 ms 09:55:11.276 [] INFO [vert.x-worker-thread-5] [i.v.e.w.h.i.LoggerHandlerImpl] - 172.23.0.1 - POST /api/v2/roles/36a6d214ab51409ba6d214ab51f09b39/permissions/projects/7780ae3334f8428b80ae3334f8728bd8/nodes/dbab36c7e8e2441aab36c7e8e2c41a54?lang=de HTTP/1.0 200 58 - 8 ms 09:55:12.848 [] INFO [vert.x-worker-thread-7] [i.v.e.w.h.i.LoggerHandlerImpl] - 172.23.0.1 - POST /api/v2/roles/36a6d214ab51409ba6d214ab51f09b39/permissions/projects/7780ae3334f8428b80ae3334f8728bd8/nodes/dbab36c7e8e2441aab36c7e8e2c41a54?lang=de HTTP/1.0 200 58 - 3 ms 09:55:13.277 [] INFO [vert.x-worker-thread-2] [c.g.m.s.v.b.BulkOperator] - Sending bulk to elasticsearch: 2 bulked requests. [UpdateDocumentRequest{transformedIndex='mesh-node-7780ae3334f8428b80ae3334f8728bd8-75dda958fe7a40ff9da958fe7a60ff48-edd3916a46034ce193916a4603bce1ed-draft', id='dbab36c7e8e2441aab36c7e8e2c41a54-en'}, UpdateDocumentRequest{transformedIndex='mesh-node-7780ae3334f8428b80ae3334f8728bd8-75dda958fe7a40ff9da958fe7a60ff48-edd3916a46034ce193916a4603bce1ed-draft', id='dbab36c7e8e2441aab36c7e8e2c41a54-en'}]

@marvin-w
Copy link
Author

I've found a workaround to this issue:

Open the developer console and select "Disable cache" in the network tab. The results look fine. However it still appears that the permissions are not properly set.

@Jotschi
Copy link
Contributor

Jotschi commented Sep 23, 2019

Maybe thats an etag issue. In that case it would be a issue in the server and not the ui. We are currently working on the perm system for the new ui. I'll talk to @philippguertler

@marvin-w
Copy link
Author

@Jotschi Thanks for taking care of it. I really like the CMS but it has some weird issues (with this being one of them). Also, I need to restart every time I change a permission in order for them to take effect.

Is there any ETA on this new UI? Can we use it already somehow?

@Jotschi
Copy link
Contributor

Jotschi commented Sep 24, 2019

@marvin-w I'm curious what issues you found. I want to make sure those are already tracked. Can you write me an email with those at [email protected] or create an extra issue?

There is no ETA for the new UI but I expect it to be released in the next few weeks. The last status I know of only lists one remaining task to be implemented.

You could use it if you build it yourself. The new UI will be included in Gentics Mesh 1.0.

@marvin-w
Copy link
Author

marvin-w commented Sep 24, 2019

I've created #882 for the other issue that I'm experiencing right now.

Can you point me to a direction on where I can find the new UI and how I'd built it. I could have a look because the current UI is almost unusable for me.

Found it: https://github.com/gentics/mesh-ui

@philippguertler
Copy link
Contributor

I got a 304 for this request in the new UI: http://localhost:4200/api/v1/projects?role=967883aa8ce74952b883aa8ce7495247&fields=uuid,name,rolePerms. Mesh should nor return a 304 because the rolePerms have changed. As @Jotschi said this is an etag issue in Mesh.

@marvin-w
Copy link
Author

Is there a reason why you use v1 of the API if there is already a v2? I'm just curious.

Also thanks @Jotschi for your nice mail! If you can point me to a direction considering the ETag issue I could have a look - but I don't know the architecture of mesh.

@Jotschi
Copy link
Contributor

Jotschi commented Sep 28, 2019

UI

The current Mesh UI uses v1. We have not updated it since it will soon be replaced by the new UI. The main difference between v1 und v2 is in the GraphQL API.

ETag Problem

The issue is here:

return ETag.hash(getUuid() + "-" + getLastEditedTimestamp());

Currently the etag is for a project response is just generated from the uuid and the last edittimestamp. This is however not enough since the rolePerms can be part of this response as well.

The method has to be adapted to be aware of the role and fields parameter. I assume there might be more. Not sure. I also suspect that other endpoints are affected by this issue as well.

The fix and tests should be easy. We'll need to address those problems for the Mesh 1.0 release anyhow. This means we need to take care of those problems next week.

@Jotschi Jotschi added this to the 1.0.0 milestone Sep 28, 2019
Jotschi added a commit that referenced this issue Sep 29, 2019
@Jotschi Jotschi self-assigned this Sep 29, 2019
Jotschi added a commit that referenced this issue Sep 30, 2019
@Jotschi
Copy link
Contributor

Jotschi commented Oct 1, 2019

Fix was released in 0.41.0

@marvin-w
Copy link
Author

marvin-w commented Oct 1, 2019

Thank you!

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

No branches or pull requests

4 participants