devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

[docs] Security/capability checks in [reportbuilder]

Open RussellEngland opened this issue 3 months ago • 0 comments

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

RussellEngland avatar Aug 11 '25 08:08 RussellEngland