# Authorization

Many actions users perform in the H5P system need authorization. By default the library will allow everything to every user. You can customize who can do what, but passing in an implementation of `IPermissionSystem` into `options.permissionSystem` of the `H5PPlayer` or `H5PEditor` constructor. The library then calls the methods of `IPermissionSystem` whenever a user performs an action that requires authorization.

See the documentation of `IPermissionSystem` for and the [`ExamplePermissionSystem`](https://github.com/Lumieducation/H5P-Nodejs-library/blob/release/packages/h5p-rest-example-server/src/ExamplePermissionSystem.ts) for reference how to implement the permission system.

Note that the `IPermissionSystem` is a generic. You can use any sub-type of `IUser` as the generic type. The call of the methods of `IPermissionSystem` will include a user of the generic type. This is the user object you've injected in your controllers. That means you can add any arbitrary date to it, like roles.

## Acknowledgement

The development of this feature was kindly funded by PHYWE Systeme GmbH und Co. KG (<https://www.phywe.de/>).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lumi.education/advanced-usage/authorization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
