silverstripe / silverstripe/developer-docs

Improve Model-Level Permissions docs

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

Nobody has claimed this yet.

type/docs
Dominant language
No language data
Stars
7
Forks
74
Avg merge
1d 14m
Merged PRs (30d)
6

Description

Affected Version

4.x

Description

Currently the docs cover very basic can permission implementations. One missing aspect of this is the importance to check permissions on your current model, then check against the parent. This is most notable with Pages in the CMS module where the $context param holds the ParentID which is utilized to determine if a given page type can be created under another given parent page type.

Solution

Describe the how $context is used in the CMS module as an example both for the ability to enhance permission logic with context, as well as the importance of that param when checking permissions if you are extending a class and providing custom permissions.

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

Locate the existing documentation covering can permissions and the CMS Pages model, then review how the $context parameter carries ParentID. Done means documenting a CMS example that uses context for parent-aware permission checks and explaining why extensions should preserve that parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authorization, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.