Wolframe, 0.0.3

authorizationFunction.hpp
Go to the documentation of this file.
1 /************************************************************************
2 Copyright (C) 2011 - 2014 Project Wolframe.
3 All rights reserved.
4 
5 This file is part of Project Wolframe.
6 
7 Commercial Usage
8 Licensees holding valid Project Wolframe Commercial licenses may
9 use this file in accordance with the Project Wolframe
10 Commercial License Agreement provided with the Software or,
11 alternatively, in accordance with the terms contained
12 in a written agreement between the licensee and Project Wolframe.
13 
14 GNU General Public License Usage
15 Alternatively, you can redistribute this file and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19 
20 Wolframe is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24 
25 You should have received a copy of the GNU General Public License
26 along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
27 
28 If you have questions regarding the use of this file, please contact
29 Project Wolframe.
30 
31 ************************************************************************/
34 
35 #ifndef _Wolframe_LANGBIND_AUTHORIZATION_FUNCTION_HPP_INCLUDED
36 #define _Wolframe_LANGBIND_AUTHORIZATION_FUNCTION_HPP_INCLUDED
37 #include "types/variant.hpp"
38 #include <string>
39 #include <vector>
40 #include <boost/shared_ptr.hpp>
41 
42 namespace _Wolframe {
43 namespace proc {
45 class ExecContext;
46 }
47 namespace langbind {
48 
52 {
53 public:
58 
61  struct Attribute
62  {
63  std::string name;
65 
67  Attribute( const Attribute& o)
68  :name(o.name),value(o.value){}
69  Attribute( const std::string& name_, const types::Variant& value_)
70  :name(name_),value(value_){}
71  };
72 
73  virtual bool call( proc::ExecContext* ctx, const std::string& resource, std::vector<Attribute>& attributes) const=0;
74 };
75 
77 typedef boost::shared_ptr<AuthorizationFunction> AuthorizationFunctionR;
78 
79 }}//namespace
80 #endif
81 
Attribute(const std::string &name_, const types::Variant &value_)
Definition: authorizationFunction.hpp:69
virtual bool call(proc::ExecContext *ctx, const std::string &resource, std::vector< Attribute > &attributes) const =0
Attribute(const Attribute &o)
Definition: authorizationFunction.hpp:67
Execution context passed to functions for referencing resources and to define authorization dependend...
Definition: execContext.hpp:47
Interface of a an authorization function.
Definition: authorizationFunction.hpp:51
types::Variant value
Definition: authorizationFunction.hpp:64
AuthorizationFunction()
Default constructor.
Definition: authorizationFunction.hpp:55
Forward declaration.
Definition: variant.hpp:65
Key value pair as authorization function result.
Definition: authorizationFunction.hpp:61
Variant value type.
std::string name
Definition: authorizationFunction.hpp:63
Attribute()
Definition: authorizationFunction.hpp:66
boost::shared_ptr< AuthorizationFunction > AuthorizationFunctionR
shared ownership reference of an authorization function
Definition: authorizationFunction.hpp:77
virtual ~AuthorizationFunction()
Destructor.
Definition: authorizationFunction.hpp:57