-
Notifications
You must be signed in to change notification settings - Fork 13
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
Update menu generator to better display existing schema IFC-834 #4716
Conversation
e52e6be
to
90f456c
Compare
90f456c
to
0437968
Compare
0437968
to
37b1a38
Compare
CodSpeed Performance ReportMerging #4716 will degrade performances by 10.8%Comparing Summary
Benchmarks breakdown
|
37b1a38
to
165e2f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend/infrahub/menu/generator.py
Outdated
|
||
if not account: | ||
return menu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should never come into play get_menu()
will always send an object but it might be an unauthenticated object. Even if that happens I think it could make sense to run the code below so that we'd also hide the admin menu for anonymous users. The function signature here could change account: AccountSession | None = None
-> account: AccountSession
165e2f4
to
0a875a4
Compare
fixes ifc-834
This PR improve the compatibility for the current schema format with the new menu. By default, if a node/generic is meant to the included in the schema it will be displayed at the top level.
Menu placement can still be used as well. In order to support the current format, the identifier for the schema is no longer using a
:
, instead the identifier is identical as the element of the schema<namespace><name>
.if a menu item with the same identifier already exist in the menu it will take precedence over what is in the schema.
This PR also adds the initial support for permissions to the menu.
For each CoreMenuItem it's now possible to defined a list of
required_permissions
, currently only global permissions are supported.At least of the permission must match for the menu to be visible.
By default, the menu
Admin
will be only visible if the user has theglobal:super_admin
permissionAnd finally, the structure of the menu has slightly changed
Credential
is now under Unified StorageWebhook
is now part of a newIntegrations
menu item