Tizen 2.1 base
[framework/security/security-server.git] / ace / include / ace / PolicyEffect.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @file    PolicyEffect.h
18  * @author  B.Grzelewski (b.grzelewski@samsung.com)
19  * @version 1.0
20  * @brief   This file contains the declaration of PolicyEffect type.
21  */
22 #ifndef _SRC_ACCESS_CONTROL_COMMON_POLICY_EFFECT_H_
23 #define _SRC_ACCESS_CONTROL_COMMON_POLICY_EFFECT_H_
24
25 enum class PolicyEffect {
26     DENY = 0,
27     PERMIT,
28     PROMPT_ONESHOT,
29     PROMPT_SESSION,
30     PROMPT_BLANKET
31 };
32
33 inline static std::ostream & operator<<(std::ostream& stream,
34                                         PolicyEffect effect)
35 {
36     switch (effect) {
37         case PolicyEffect::DENY:           stream << "DENY"; break;
38         case PolicyEffect::PERMIT:         stream << "PERMIT"; break;
39         case PolicyEffect::PROMPT_ONESHOT: stream << "PROMPT_ONESHOT"; break;
40         case PolicyEffect::PROMPT_SESSION: stream << "PROMPT_SESSION"; break;
41         case PolicyEffect::PROMPT_BLANKET: stream << "PROMPT_BLANKET"; break;
42         default: Assert(false && "Invalid PolicyEffect constant");
43     }
44     return stream;
45 }
46
47 #endif // _SRC_ACCESS_CONTROL_COMMON_POLICY_EFFECT_H_