moodle / moodle/devdocs

[docs] Security/capability checks in [reportbuilder]

Open
#1,414 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement help wanted needs-triage
Dominant language
TypeScript
Stars
74
Forks
652
Avg merge
2d 50m
Merged PRs (30d)
12

Description

What is the Moodle feature that needs documenting?

versioned_docs/version-5.0/apis/core/reportbuilder

Could you add documentation for security/capability checks please :)

I think to restrict access to a data entity it is the is_available function?

eg: in local/myplugin/classes/reportbuilder/local/entities/mydata.php

public function is_available(): bool {
    return has_capability('local/myplugin:viewreport', context_system::instance());
}
Is this documentation specific to a Moodle version?

None

Are you able to provide a patch for this?

None

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 with versioned_docs/version-5.0/apis/core/reportbuilder and review the surrounding reportbuilder API guidance. Use the issue's is_available() example and capability check as the reference point; done means the documentation explains how to restrict a data entity's access and includes an applicable example.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authorization, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.