torchbox / torchbox/django-pattern-library

Access permission

Open
#210 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
423
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Is your proposal related to a problem?

I want to make this live on production for a certain group of users.

I know that the pattern library can affect the site it's on because you can execute Python from templates so it's a security risk. Documentation could state that and this could be an opt-in only.

Describe the solution you'd like
  • Create a custom Django permission to restrict who can see the pattern library as part of the package.
  • Add Wagtail hooks for permission and maybe a Wagtail menu item for the pattern library as well. Probably a separate issue but would follow from this as we'd first want to restrict access.
Describe alternatives you've considered
  • Creating a permission decorator in my own project and guarding the URL paths.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the package's URL paths and how Django permissions are defined and enforced. Review the proposed custom permission and the possible Wagtail hooks or menu item, then clarify whether Wagtail integration belongs in this issue. Done means access to the pattern library can be restricted to an intended user group and the security implications are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
authorization, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.