Skip to content

JSONEditor not displayed when user doesn't have the permissions to edit the object  #73

@haidaraM

Description

@haidaraM

Hi,

First of all. Thanks for your work on this lib.

I disabled the change permission with this code in the model admin class:

    def has_change_permission(self, request, obj=None):
        return False

However, after doing that the JSONEditor is no longer displayed. Is this expected? My expectation was to see the JSONEditor in read only mode as well. It works if I put all fields in readonly_fields in the model admin class.

I compared the HTML file and noticed that this package static files (JS, CSS) are not included when the has_change_permission returns False.

Thanks in advance for your help

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