Skip to content

[docs] Improve documentation around capability contextlevel in the docs #1339

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

Open
NeillM opened this issue May 2, 2025 · 0 comments · May be fixed by #1349
Open

[docs] Improve documentation around capability contextlevel in the docs #1339

NeillM opened this issue May 2, 2025 · 0 comments · May be fixed by #1349
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed needs-triage

Comments

@NeillM
Copy link
Contributor

NeillM commented May 2, 2025

What is the URL of the page?

https://moodledev.io/docs/5.0/apis/subsystems/access#how-to-define-new-capabilities-in-plugins

What is the issue with this page?

In the dev chat there was a discussion around what contextlevel on capabilities does and means we seemed to come up with a good description that is not included in the docs at the moment:

It indicates what context you intend to check the capability at, and does control where it appears, for instance moodle/site:config is defined as CONTEXT_SYSTEM and that means you can't change it at lower levels. If you go to a course (or category, or module or block, or user for that matter) and try to override capabilities there, that one doesn't show on the list. Because if you did override it in a course, it wouldn't make any difference when you check it as context system.

It seems that adding this or something similar will help people understand what contextlevel they should choose to use better.

Are you able to provide a patch for this?

If no one picks this up sooner, I'll likely do it next week

@NeillM NeillM added bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed labels May 2, 2025
@NeillM NeillM changed the title [docs] Improve documentation around the contextlevel in the docs [docs] Improve documentation around capability contextlevel in the docs May 2, 2025
NeillM added a commit to NeillM/devdocs that referenced this issue May 9, 2025
…tion

There was confusion in the developer chat channel around how the context level should be set in.

This change will hopefully help make it clear how the context level should be set and what its effect is.
NeillM added a commit to NeillM/devdocs that referenced this issue May 9, 2025
…tion

There was confusion in the developer chat channel around how the context level should be set in.

This change will hopefully help make it clear how the context level should be set and what its effect is.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed needs-triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant