<commit_before># Authorization

## Login required

## Permissions

## Groups

// A little exemple with the admin board for exemple.<commit_msg>Add authorization docs.<commit_after># Authorization

Access control is managed with permissions and groups.

Groups are sets of users. A user can belong to several groups and a group can have several users.

Permissions control the user accesses. It is considered that a user has a given permission if it or one of its has this permission.

A permission has a `name` and an unique `codeName`.

A group has a `name` and `permissions`.

A user has `groups`, `userPermissions` and a `hasPerm` method.

## Hooks

The `LoginRequired()` hook returns a `401 Unauthorized` if no user is authenticated.

The `PermissionRequired(perm: string)` hook returns a `403 Forbidden` if the user does not have the given permission. Its argument is the `codeName` of the permission.
{'fraction_non_alphanumeric': 0.0673289183222958, 'fraction_numerical': 0.006622516556291391, 'mean_word_length': 4.496969696969697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '752227', 'n_tokens_mistral': 242, 'n_tokens_neox': 237, 'n_words': 132}