#11165: Option to deny app context for normal users#11183
#11165: Option to deny app context for normal users#11183allyoucanmap merged 4 commits intogeosolutions-it:masterfrom
Conversation
Description: - introduce a new cfg called 'cateogries' for plugin 'ResourcesGrid' to control browse resources in the new home page, it is a dictionary contains resources for ADMIN, USER, COMMON - add unit tests
There was a problem hiding this comment.
I created a proposal for some changes on this branch https://github.com/allyoucanmap/MapStore2/tree/issue_11165 (2625543253bf9a05dfeff9b3e8e7633b58e89baf). Here major changes:
- ranamed catagories to resourceTypes
- stored resourceTypes in the redux state
- make resourceTypes accessible from the monitored state
- include a new context requires function called
isResourceTypeSupportedusable inside the localConfig as expression - add disabledIf expression to prevent some item to be shown if a specific resource type is not available (eg.
"disableIf": "{!context.isResourceTypeSupported('CONTEXT', state('resourceTypes'), state('userrole'))}") - added disableIf to default configuration of filter panel
before proceed I would like a feedback (cc @tdipisa )
|
@mahmoudadel54 I just pushed some code I reviewed with @offtherailz, most of the implementation now on the
|
- add migration guides to 2025.01.01 - add missing unit tests for 'getSupportedResourceTypes', 'isMenuItemSupportedSupported' utils - add missing unit tests for 'getAvailableResourceTypes'
|
@ElenaGallo please test this on a local instance of mapstore using master because you need to configure localConfig.json as described in the PR description, then let us know if we can backport on 2025.01.xx, thanks |
|
Test passed, @mahmoudadel54 please backport to 2025.01.xx. Thanks |
…eosolutions-it#11183) --------- Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>
Backport is done --> #11262 |
Description
In this PR, we introduce a new cfg called 'resourceTypes' for plugin 'ResourcesGrid' to control browse resources in the new home page, it is a dictionary contains resources for ADMIN, USER, anonymous for example:
each array is the available resources to browse for user and anonymous is for guest user [Anonymous user]. So this is for browse contexts point in requirements if we provide a list without CONTEXT the shown/fetched resouces will be only the provided ones. The default value for resourceTypes is
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
#11165
What is the new behavior?
We can manage the browse resources in new home page using by the new cfg 'resourceTypes' into plugin 'ResourcesGrid'. To manage hiding edit/create/filter context from new home page UI, we can do that using the same cfg 'resourceTypes' for plugins 'ResourcesGrid' of catalog and 'ResourcesFiltersForm' like the clarification above.
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information