Access control rule for entity permissions.
More...
#include <access_rules.h>
Access control rule for entity permissions.
Modes: public, auth (optional comma-separated entity filter), custom (expr), or empty string (admin only).
◆ MbAccessRule()
| mb::MbAccessRule::MbAccessRule |
( |
const std::string & | mode = "", |
|
|
const std::string & | expr = "", |
|
|
const std::string & | entity = "" ) |
|
explicit |
Construct a rule from mode, optional custom expression, and optional entity filter.
◆ entity()
| std::string mb::MbAccessRule::entity |
( |
| ) |
const |
|
nodiscard |
Comma-separated auth entity filter for auth mode (e.g. users, users,editors, !guests).
◆ expr()
| std::string mb::MbAccessRule::expr |
( |
| ) |
const |
|
nodiscard |
- Returns
- Custom expression when mode is custom.
◆ fromJSON()
| MbAccessRule mb::MbAccessRule::fromJSON |
( |
const nlohmann::json & | j | ) |
|
|
static |
Parse rule from stored schema JSON.
◆ matchesAuthEntity()
| bool mb::MbAccessRule::matchesAuthEntity |
( |
const std::string & | userEntity | ) |
const |
|
nodiscard |
Check whether userEntity satisfies the auth mode entity filter.
◆ mode()
| std::string mb::MbAccessRule::mode |
( |
| ) |
const |
|
nodiscard |
- Returns
- Rule mode: public, auth, custom, or empty (admin-only).
◆ setEntity()
| void mb::MbAccessRule::setEntity |
( |
const std::string & | _entity | ) |
|
◆ setExpr()
| void mb::MbAccessRule::setExpr |
( |
const std::string & | _expr | ) |
|
◆ setMode()
| void mb::MbAccessRule::setMode |
( |
const std::string & | _mode | ) |
|
◆ toJSON()
| nlohmann::json mb::MbAccessRule::toJSON |
( |
| ) |
const |
|
nodiscard |
The documentation for this class was generated from the following files:
- /home/runner/work/mantisbase/mantisbase/include/mantisbase/core/models/access_rules.h
- /home/runner/work/mantisbase/mantisbase/src/core/models/access_rules.cpp