Hi,
i’ve encountered a weird situation that relates to the permission of cuba.gui.filter.maxResults and the corresponding paging feature in an browse screen. It only happens if the fts module is used in the build.gradle and the Application propertty fts.enabled = true is configured. It does not to be active in the browse screen i describe later, it just has to be activated.
Here’s the example:
I’ve a app with an entity Customer (with property “name”). Additionally i created the following security roles:
- “Deny” (Type: Deny, permissions:CRUD on customer)
- “Allow” (Type: Standard, permissions:CRUD on customer, allow for “Specific > Unlimited number of rows”)
Then i created corresponding users:
- “deny” (password: “deny”, roles: [Deny])
- “allow” (password: “allow”, roles: [Deny, Allow])
There are two independent problems i see.
First: Naming of the permission “Specific > Unlimited number of rows”:
(This one is even weird if fts is not configured, so it also happens with the dependency is not used)
I would expect to see the following:
When i login as “deny” i can go to the browse screen of the customer. I can select the amount elements per page i want to see and switch between 20-1000. But i can’t select “unlimited” because i’m not allowed to do so.
In reality i see the following:
When i login as “deny” i can go to the browse screen of the customer. I can’t select the amount elements per page i want to see and switch between 20-1000. 50 Elements per page is defined hard and i can’t change it.
I would assume by the translation of the security permission which is called “Unlimited number of rows”, that i would only add the permission to see all elements, but not if i deny this role that i’m not allowed to switch the page size entirely.
Second: Deny User is allowed to see all elements by hitting search:
I would expect to see the following:
When i login as “deny” i can go to the browse screen of the customer. When i don’t change anything in the filter and hit “search” i will get the first 50 elements because of the configured page size.
In reality i see the following:
When i login as “deny” i can go to the browse screen of the customer. When i don’t change anything in the filter and hit “search” i will get all elements.
This effectively means that i am allowed to see unlimited elements (which is the opposite i just configured via the Deny role).
When i do that with the allow user, i will get only the first 50 results (as expected).
The problematic is probably FilterDelegate.isMaxResultsLayoutVisible().
Attached you’ll find the example project as well as a screencast showing the problem in the application.
Bye
Mario