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

How to setup the access for the subscreens not only for the menu index 1 #397

Closed
lightning-pro opened this issue Jan 8, 2020 · 3 comments

Comments

@lightning-pro
Copy link

Hi, from the example component, there is a demo setup of component://example/screen/ExampleApp/Example.xml with an user example.ltd, yes ,this can access the Example page only as expected.
But once only need to setup for other pages like component://example/screen/ExampleApp/Feature.xml, this is not working, no menu at all.

after some testing, I found that only the page with default-menu-index="1" works, but most of the case ,we need to setup different users groups to visit different pages(e.g. some user only access Feature.xml page). I event try to the deny combination of the setup, but still fails.
any setup examples can take reference?

@jonesde
Copy link
Member

jonesde commented Jan 8, 2020

More details needed, please see the Bugs and General Issues section here:

https://www.moqui.org/m/docs/moqui/Issue+and+Pull+Request+Guide#bugs-and-general-issues

Information needed for a issues in general are: 1. Steps to Reproduce (what did you do), 2. What Happened (what did the system do), and 3. What Should Have Happened (what is the difference between what the system did and what you expected).

From what you wrote there seem to be multiple issues so you'd have a set of these 3 for each. Each needs to be a specific case to have any hope of communication adequate for anyone reviewing the issue to reproduce what you're doing and have a decent chance of being helpful whether it be fixing something in the framework or pointing out issues in your code or configuration.

@lightning-pro
Copy link
Author

OK, for short,you can follow below steps to reproduce it

  1. install the example component and import all the related data

  2. change the artifactName of ArtifactGroupMember with artifactGroupId= EXAMPLE_LTD to be component://example/screen/ExampleApp/Feature.xml.

  3. relogin with user example.ltd

no menu and content would displayed after you login.

@jonesde
Copy link
Member

jonesde commented Jan 11, 2020

Basically in step #2 you removed the default authorization for the ExampleApp.xml screen and when you tried to render it or check if the user is authorized (as part of the render path for the Feature.xml screen) it failed because there is no authorization.

For docs on the artifact stack and how it works with authorization see:

https://moqui.org/m/docs/framework/Security

For an example of how to do this see the authz setup for the POPC ERP app:

https://github.com/moqui/PopCommerce/blob/master/data/PopCommerceAaaSetupData.xml

In short you need authorization for the root screen of the app or it won't be allowed, and to not grant authz for the entire app by using a non-inherited authz as mentioned in the comment on line 57.

@jonesde jonesde closed this as completed Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants