2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 // @ Project : Access Control Engine
20 // @ File Name : Rule.h
21 // @ Date : 2009-05-06
29 #include "Attribute.h"
31 #include "Condition.h"
32 #include <dpl/assert.h>
34 class Rule : public AbstractTreeElement
38 ExtendedEffect evaluateRule(const AttributeSet * attrSet) const;
41 : effect(Inapplicable)
43 //TODO we should set it to deny or smth, not inapplicable
46 void setEffect(ExtendedEffect effect)
48 //We should not allow to set "Inapplicable" effect.
49 //Rules cannot have effect that is inapplicable, evaluation of the rules may however
50 //render the effect inapplicable.
51 Assert(effect.getEffect() != Inapplicable);
52 this->effect = effect;
54 void setCondition(Condition condition)
56 this->condition = condition;
58 void getAttributes(AttributeSet * attrSet)
60 condition.getAttributes(attrSet);
64 std::string printEffect(const ExtendedEffect &effect) const;
69 ExtendedEffect effect;