-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Can configure admin to add and delete permissions #117
Changes from all commits
8b6423f
07a0842
0434da9
02ec35d
0487d92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,16 @@ | |
list_editable = value_fields_names | ||
sortable_by = ("name",) | ||
|
||
def has_add_permission(self, request): | ||
if settings.EXTRA_SETTINGS_ADMIN_ADD_PERMISSIO: | ||
return False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the setting value is |
||
return super().has_add_permission(request) | ||
|
||
def has_delete_permission(self, request, obj=None): | ||
if settings.EXTRA_SETTINGS_ADMIN_DELETE_PERMISSIO: | ||
return False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the setting value is |
||
return super().has_delete_permission(request, obj) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a typo in the setting name, it should be |
||
|
||
def get_changelist_form(self, request, **kwargs): | ||
return SettingForm | ||
|
||
|
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.
There is a typo in the setting name, it should be
.._PERMISSION
.