Access control rule for entity permissions.
More...
#include <access_rules.h>
|
| | AccessRule (const std::string &mode="", const std::string &expr="") |
| | Construct access rule.
|
| |
| nlohmann::json | toJSON () const |
| | Convert rule to JSON representation.
|
| |
| std::string | mode () const |
| | Get rule mode.
|
| |
| void | setMode (const std::string &_mode) |
| | Set rule mode.
|
| |
| std::string | expr () const |
| | Get expression string.
|
| |
| void | setExpr (const std::string &_expr) |
| | Set expression string.
|
| |
Access control rule for entity permissions.
Defines who can access entity operations using expression-based rules. Rules consist of a mode (currently unused) and an expression string that is evaluated against request context.
AccessRule adminRule(
"",
"auth.entity == \"mb_admins\"");
Access control rule for entity permissions.
Definition access_rules.h:31
◆ AccessRule()
| mb::AccessRule::AccessRule |
( |
const std::string & |
mode = "", |
|
|
const std::string & |
expr = "" |
|
) |
| |
|
explicit |
Construct access rule.
- Parameters
-
| mode | Rule mode (currently unused, reserved for future use) |
| expr | Expression string to evaluate (e.g., "auth.id != \"\"") |
◆ expr()
| std::string mb::AccessRule::expr |
( |
| ) |
const |
Get expression string.
- Returns
- Expression string
◆ fromJSON()
| AccessRule mb::AccessRule::fromJSON |
( |
const nlohmann::json & |
j | ) |
|
|
static |
Create rule from JSON object.
- Parameters
-
| j | JSON object with mode and expr fields |
- Returns
- AccessRule instance
◆ mode()
| std::string mb::AccessRule::mode |
( |
| ) |
const |
Get rule mode.
- Returns
- Mode string
◆ setExpr()
| void mb::AccessRule::setExpr |
( |
const std::string & |
_expr | ) |
|
Set expression string.
- Parameters
-
| _expr | Expression string (e.g., "auth.id != \"\"") |
◆ setMode()
| void mb::AccessRule::setMode |
( |
const std::string & |
_mode | ) |
|
Set rule mode.
- Parameters
-
◆ toJSON()
| nlohmann::json mb::AccessRule::toJSON |
( |
| ) |
const |
Convert rule to JSON representation.
- Returns
- JSON object with mode and expr fields
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