MantisBase v0.4.9
Loading...
Searching...
No Matches
access_rules.h File Reference

Access rule definition and shared evaluation for entity permissions. More...

#include <string>
#include <utility>
#include <nlohmann/json.hpp>
#include <mantisbase/core/types.h>
Include dependency graph for access_rules.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mb::MbAccessEvalContext
class  mb::MbAccessRule
 Access control rule for entity permissions. More...

Namespaces

namespace  mb

Enumerations

enum class  mb::MbAccessEvalResult { mb::Allow , mb::DenyUnauthenticated , mb::DenyForbidden , mb::DenyUnknownRule }

Functions

MANTISBASE_API bool mb::isGuestAuth (const nlohmann::json &auth)
MANTISBASE_API bool mb::isAdminAuth (const nlohmann::json &auth)
MANTISBASE_API bool mb::isUserAuth (const nlohmann::json &auth)
MANTISBASE_API MbAccessEvalResult mb::evaluateAccessRule (const MbAccessRule &rule, const MbAccessEvalContext &ctx)
MANTISBASE_API nlohmann::json mb::buildAccessExprVars (const MbRequest &req, const nlohmann::json &auth)
MANTISBASE_API nlohmann::json mb::buildAccessExprVars (const nlohmann::json &auth, const std::string &remote_addr, int remote_port, const std::string &local_addr, int local_port, const nlohmann::json &body=nlohmann::json::object())
MANTISBASE_API std::pair< int, std::string > mb::accessEvalHttpError (MbAccessEvalResult result, const MbAccessRule &rule=MbAccessRule{})

Detailed Description

Access rule definition and shared evaluation for entity permissions.