Prevent creating draftsharing link snippets via admin - #13
Open
kevinhowbrook wants to merge 1 commit into
Open
Conversation
kevinhowbrook
force-pushed
the
fix/issue-12-hide-add-link
branch
from
February 6, 2026 11:35
0497ace to
7722e3c
Compare
kevinhowbrook
marked this pull request as draft
February 6, 2026 11:36
kevinhowbrook
force-pushed
the
fix/issue-12-hide-add-link
branch
2 times, most recently
from
February 6, 2026 11:48
0827e13 to
055afc6
Compare
kevinhowbrook
marked this pull request as ready for review
February 6, 2026 11:51
kevinhowbrook
force-pushed
the
fix/issue-12-hide-add-link
branch
from
February 6, 2026 11:58
055afc6 to
b6ce810
Compare
Member
|
Suggestion: Could also consider removing https://docs.djangoproject.com/en/6.0/ref/models/options/#default-permissions |
tm-kn
reviewed
Feb 6, 2026
| return False | ||
| return super().user_has_permission(user, action) | ||
|
|
||
| class WagtaildraftsharingLinkSnippetViewSet(SnippetViewSet): |
Member
There was a problem hiding this comment.
Nitpick: Could also add_view_class = None to ensure that code path is not working, but redundant. There's no one way to disable the add view I guess.
Author
There was a problem hiding this comment.
that doesnt work on wagtail 5 though i dont think?
Introduce a custom permission policy to disable the add action on the draftsharing link snippet viewset and add admin view tests to ensure the add button is hidden.
kevinhowbrook
force-pushed
the
fix/issue-12-hide-add-link
branch
from
February 6, 2026 15:23
b6ce810 to
d604024
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #12
Introduce a custom permission policy to disable the add action on the draftsharing link snippet viewset and add admin view tests to ensure the add button is hidden. This is opposed to creating a form here to generate a link, which seems a bit counterintuitive to me.
Before:

After:
