Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
JConstrCont.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: JConstrCont.h 5992 2026-09-12 09:32:44Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2007 - 2026
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 */
37
40#ifndef __JConstrCont_h
41#define __JConstrCont_h
42
43#include "JUserCont.h"
44#include "BaServerLib.h"
45#include "HashTable.h"
46
63typedef struct JConstrCont
64#ifdef __cplusplus
65 : public AuthorizerIntf
66{
71 JConstrCont(JUserCont* userCont, AllocatorIntf* alloc=0);
85 void setConstraints(JVal* constraintsVal, JErr* err);
86
92 void setCaseInsensitive();
93
94#else
95{
96 AuthorizerIntf super; /* We inherit from AuthorizerIntf */
97#endif
98
99 DoubleList resourceList;
100 JUserCont* userCont;
101 HashTable* resourceTable;
102 int noOfResources;
103 AllocatorIntf* alloc;
104 BaBool caseSensensitive;
105
107
108#ifdef __cplusplus
109extern "C" {
110#endif
117 AllocatorIntf* alloc);
126 JVal* constraintsVal, JErr* err);
129#define JConstrCont_setCaseInsensitive(o) (o)->caseSensensitive=FALSE
130#ifdef __cplusplus
131}
133 JConstrCont_constructor(this, userCont, alloc); }
136inline void JConstrCont::setConstraints(JVal* constraintsVal, JErr* err) {
137 JConstrCont_setConstraints(this,constraintsVal, err); }
140}
141#endif
142
143#endif
144
BA_API void JConstrCont_setConstraints(JConstrCont *o, JVal *constraintsVal, JErr *err)
Replace rules without rollback on failure.
BA_API void JConstrCont_constructor(JConstrCont *o, JUserCont *userCont, AllocatorIntf *alloc)
Initialize an empty rule container.
#define JConstrCont_setCaseInsensitive(o)
Enable case-insensitive prefix matching.
Definition: JConstrCont.h:129
BA_API void JConstrCont_destructor(JConstrCont *o)
Release rules after detaching the authorizer from its users.
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
An abstract class, which you must implement, provides a method of authorizing an authenticated user.
Definition: AuthenticatedUser.h:115
Authorization rules loaded from a parsed JSON object.
Definition: JConstrCont.h:66
void setCaseInsensitive()
Make prefix-rule comparisons case-insensitive.
Definition: JConstrCont.h:138
~JConstrCont()
Release the stored rules; does not destroy userCont or its allocator.
Definition: JConstrCont.h:134
void setConstraints(JVal *constraintsVal, JErr *err)
Replace rules from a parsed JSON object.
Definition: JConstrCont.h:136
JConstrCont(JUserCont *userCont, AllocatorIntf *alloc=0)
Initialize an empty rule container.
Definition: JConstrCont.h:132
The JSON error container object.
Definition: JParser.h:173
User database implementing UserIntf, loaded from a parsed JSON object.
Definition: JUserCont.h:93
JVal represents a value in a JSON tree.
Definition: JVal.h:78