cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
roleacl.h
1/*
2 * SPDX-FileCopyrightText: (C) 2014-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef ROLEACL_H
6#define ROLEACL_H
7
8#include <Cutelyst/component.h>
9#include <Cutelyst/componentfactory.h>
10#include <Cutelyst/context.h>
11#include <Cutelyst/cutelyst_global.h>
12
13#include <QtCore/QVariantHash>
14
15namespace Cutelyst {
16
17class RoleACLPrivate;
18class CUTELYST_PLUGIN_ACTION_ROLEACL_EXPORT RoleACL final : public Component
19{
21 Q_DECLARE_PRIVATE(RoleACL)
22public:
26 explicit RoleACL(QObject *parent = nullptr);
27
31 virtual Modifiers modifiers() const override;
32
36 virtual bool init(Application *application, const QVariantHash &args) override;
37
41 virtual bool aroundExecute(Context *c, QStack<Component *> stack) override;
42
46 bool canVisit(Context *c) const;
47
48protected:
52 virtual bool dispatcherReady(const Dispatcher *dispatcher, Controller *controller) override;
53};
54
55class RoleACLFactory final
56 : public QObject
57 , public ComponentFactory
58{
60 Q_PLUGIN_METADATA(IID "org.cutelyst.ComponentFactory" FILE "metadata.json")
62public:
63 virtual Component *createComponent(QObject *parent) override { return new RoleACL(parent); }
64};
65
66} // namespace Cutelyst
67
68#endif // ROLEACL_H
The Cutelyst Application.
Definition application.h:43
The Cutelyst Component base class.
Definition component.h:26
Component(QObject *parent=nullptr)
Definition component.cpp:11
The Cutelyst Context.
Definition context.h:39
The Cutelyst Dispatcher.
Definition dispatcher.h:28
virtual Component * createComponent(QObject *parent) override
Definition roleacl.h:63
User role-based authorization action class.
Definition roleacl.h:19
bool canVisit(Context *c) const
Definition roleacl.cpp:179
virtual bool init(Application *application, const QVariantHash &args) override
Definition roleacl.cpp:132
RoleACL(QObject *parent=nullptr)
Definition roleacl.cpp:122
virtual bool aroundExecute(Context *c, QStack< Component * > stack) override
Definition roleacl.cpp:166
virtual Modifiers modifiers() const override
Definition roleacl.cpp:127
virtual bool dispatcherReady(const Dispatcher *dispatcher, Controller *controller) override
Definition roleacl.cpp:219
The Cutelyst namespace holds all public Cutelyst API.
Definition Mainpage.dox:8
QObject(QObject *parent)
Q_INTERFACES(...)
Q_OBJECTQ_OBJECT
QObject * parent() const const