Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
rights.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief Defines functions describing rights
29 *
30 * @file rights.h
31 */
32
33#ifndef API_MIP_PROTECTION_RIGHTS_H_
34#define API_MIP_PROTECTION_RIGHTS_H_
35
36#include <string>
37#include <vector>
38
39#include "mip/mip_namespace.h"
40
41MIP_NAMESPACE_BEGIN
42
43namespace rights {
44/**
45 * @brief Gets string identifier for 'owner' right
46 *
47 * @return String identifier for 'owner' right
48 */
49inline std::string Owner() { return "OWNER"; }
50
51/**
52 * @brief Gets string identifier for 'view' right
53 *
54 * @return String identifier for 'view' right
55 */
56inline std::string View() { return "VIEW"; }
57
58/**
59 * @brief Gets string identifier for 'audited extract' right
60 *
61 * @return String identifier for 'audited extract' right
62 */
63inline std::string AuditedExtract() { return "AUDITEDEXTRACT"; }
64
65/**
66 * @brief Gets string identifier for 'edit' right
67 *
68 * @return String identifier for 'edit' right
69 */
70inline std::string Edit() { return "EDIT"; }
71
72/**
73 * @brief Gets string identifier for 'export' right
74 *
75 * @return String identifier for 'export' right
76 */
77inline std::string Export() { return "EXPORT"; }
78
79/**
80 * @brief Gets string identifier for 'extract' right
81 *
82 * @return String identifier for 'extract' right
83 */
84inline std::string Extract() { return "EXTRACT"; }
85
86/**
87 * @brief Gets string identifier for 'print' right
88 *
89 * @return String identifier for 'print' right
90 */
91inline std::string Print() { return "PRINT"; }
92
93/**
94 * @brief Gets string identifier for 'comment' right
95 *
96 * @return String identifier for 'comment' right
97 */
98inline std::string Comment() { return "COMMENT"; }
99
100/**
101 * @brief Gets string identifier for 'reply' right
102 *
103 * @return String identifier for 'reply' right
104 */
105inline std::string Reply() { return "REPLY"; }
106
107/**
108 * @brief Gets string identifier for 'reply all' right
109 *
110 * @return String identifier for 'reply all' right
111 */
112inline std::string ReplyAll() { return "REPLYALL"; }
113
114/**
115 * @brief Gets string identifier for 'forward' right
116 *
117 * @return String identifier for 'forward' right
118 */
119inline std::string Forward() { return "FORWARD"; }
120
121/**
122 * @brief Gets string identifier for 'view rights data' right
123 *
124 * @return String identifier for the right
125 */
126inline std::string ViewRightsData() { return "VIEWRIGHTSDATA"; }
127
128/**
129 * @brief Gets string identifier for 'document edit' right
130 *
131 * @return String identifier for the right
132 */
133inline std::string DocumentEdit() { return "DOCEDIT"; }
134
135/**
136 * @brief Gets string identifier for 'object model' right
137 *
138 * @return String identifier for the right
139 */
140inline std::string ObjectModel() { return "OBJMODEL"; }
141
142/**
143 * @brief Gets string identifier for 'edit rights data' right
144 *
145 * @return String identifier for the right
146 */
147inline std::string EditRightsData() { return "EDITRIGHTSDATA"; }
148
149/**
150 * @brief Gets a list of rights that apply to emails
151 *
152 * @return A list of rights that apply to emails
153 */
154inline std::vector<std::string> EmailRights() {
155 return std::vector<std::string>{Extract(), Forward(), Owner(), Print(), Reply(), ReplyAll(), View()};
156}
157
158/**
159 * @brief Gets a list of rights that apply to documents
160 *
161 * @return A list of rights that apply to documents
162 */
163inline std::vector<std::string> EditableDocumentRights() {
164 return std::vector<std::string>{Comment(), Edit(), Extract(), Owner(), Print(), View()};
165}
166
167/**
168 * @brief Gets a list of rights that apply in all scenarios
169 *
170 * @return A list of rights that apply in all scenarios
171 */
172inline std::vector<std::string> CommonRights() {
173 return std::vector<std::string>{Owner(), View()};
174}
175
176/**
177 * @brief Gets a list of rights that apply to do not forward emails
178 *
179 * @return A list of rights
180 */
181inline std::vector<std::string> DoNotForwardRights() {
182 return std::vector<std::string>{
183 View(),
184 Edit(),
185 ObjectModel(),
187 Reply(),
188 ReplyAll(),
189 DocumentEdit()};
190}
191
192/**
193 * @brief Gets a list of rights that apply to do encrypt only emails
194 *
195 * @return A list of rights
196 */
197inline std::vector<std::string> EncryptOnlyRights() {
198 return std::vector<std::string>{
199 View(),
200 Edit(),
201 Extract(),
202 Print(),
203 ObjectModel(),
205 Forward(),
206 Reply(),
207 ReplyAll(),
208 DocumentEdit(),
210}
211} // namespace rights
212MIP_NAMESPACE_END
213
214#endif // API_MIP_PROTECTION_RIGHTS_H_
MIP namespace macros.
std::vector< std::string > EncryptOnlyRights()
Gets a list of rights that apply to do encrypt only emails.
Definition rights.h:197
std::string EditRightsData()
Gets string identifier for 'edit rights data' right.
Definition rights.h:147
std::string Reply()
Gets string identifier for 'reply' right.
Definition rights.h:105
std::string View()
Gets string identifier for 'view' right.
Definition rights.h:56
std::string ObjectModel()
Gets string identifier for 'object model' right.
Definition rights.h:140
std::string Comment()
Gets string identifier for 'comment' right.
Definition rights.h:98
std::string Edit()
Gets string identifier for 'edit' right.
Definition rights.h:70
std::string ViewRightsData()
Gets string identifier for 'view rights data' right.
Definition rights.h:126
std::string Owner()
Gets string identifier for 'owner' right.
Definition rights.h:49
std::vector< std::string > DoNotForwardRights()
Gets a list of rights that apply to do not forward emails.
Definition rights.h:181
std::string Export()
Gets string identifier for 'export' right.
Definition rights.h:77
std::string Print()
Gets string identifier for 'print' right.
Definition rights.h:91
std::string Extract()
Gets string identifier for 'extract' right.
Definition rights.h:84
std::string ReplyAll()
Gets string identifier for 'reply all' right.
Definition rights.h:112
std::string Forward()
Gets string identifier for 'forward' right.
Definition rights.h:119
std::vector< std::string > CommonRights()
Gets a list of rights that apply in all scenarios.
Definition rights.h:172
std::string AuditedExtract()
Gets string identifier for 'audited extract' right.
Definition rights.h:63
std::vector< std::string > EditableDocumentRights()
Gets a list of rights that apply to documents.
Definition rights.h:163
std::vector< std::string > EmailRights()
Gets a list of rights that apply to emails.
Definition rights.h:154
std::string DocumentEdit()
Gets string identifier for 'document edit' right.
Definition rights.h:133