Csilk 0.2.1
A lightweight, high-performance C HTTP web framework
Loading...
Searching...
No Matches
csilk_perm_driver_t Struct Reference

Virtual function table for a permission/ACL driver. More...

#include <perm.h>

Data Fields

const char * name
 
int(* check )(csilk_ctx_t *c, const char *permission, const char *resource)
 Evaluate whether the request is allowed.
 

Detailed Description

Virtual function table for a permission/ACL driver.

Implementations evaluate whether a given user (identified through the request context) holds a specific permission on a resource.

Note
The check function is called synchronously on the event-loop thread. For database-backed drivers, use a fast cache or async offload.

Field Documentation

◆ check

int(* csilk_perm_driver_t::check) (csilk_ctx_t *c, const char *permission, const char *resource)

Evaluate whether the request is allowed.

Parameters
cRequest context (used to identify the authenticated user).
permissionPermission string (e.g., "read", "write", "delete").
resourceResource pattern (e.g., "users:*", "documents:42").
Returns
0 if allowed, non-zero if denied.

◆ name

const char* csilk_perm_driver_t::name

Driver identifier (e.g., "simple", "casbin").


The documentation for this struct was generated from the following file: