Skip to content

Defining menu items can break for users without permissions #130

@nielsvanoch

Description

@nielsvanoch

If you define the JET_SIDE_MENU_ITEMS setting with a list of models, for instance like this:

JET_SIDE_MENU_ITEMS = [
    {
        'label': 'foo',
        'items': [
            {
                	'label': 'bar',
                	'url': {'type': 'model', 'app_label': 'foo', 'model': 'bar'},
             },
        ],
    },
]

When a user that does not have any permissions to the foo.bar model tries to load the admin, they will trigger a KeyError here: https://github.com/assem-ch/django-jet-reboot/blob/master/jet/utils.py#L310, since the model won't be present in models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions