silverstripe / silverstripe/developer-docs
Improve Model-Level Permissions docs
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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