|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This header file describes the LBT security policy that is |
|
15 * used by LT container to access/modify the database |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef LBTSECURITYPOLICY |
|
21 #define LBTSECURITYPOLICY |
|
22 |
|
23 /** |
|
24 * This class provides the inteface to define security policy. As of now |
|
25 * the security policy only provides for security check based on secure id. |
|
26 * This class will be extended any future requirements for security checking |
|
27 * |
|
28 * The inteface provides the following functionality, |
|
29 * - Define policy for a particular process based on secure id |
|
30 * |
|
31 * @lib lbtcontainer.lib |
|
32 * @since S60 v4.0 |
|
33 */ |
|
34 class TLbtSecurityPolicy |
|
35 { |
|
36 public: |
|
37 // Default constructor |
|
38 TLbtSecurityPolicy() |
|
39 { |
|
40 iOwnerSecureId = KNullUidValue; |
|
41 } |
|
42 |
|
43 // Copy constructor |
|
44 TLbtSecurityPolicy(const TLbtSecurityPolicy& aSecurityPolicy) |
|
45 { |
|
46 iOwnerSecureId = aSecurityPolicy.GetOwnerSecureId(); |
|
47 } |
|
48 |
|
49 // Sets the secure id |
|
50 inline void SetOwnerSecureId(TSecureId aSecureId) |
|
51 { |
|
52 iOwnerSecureId = aSecureId; |
|
53 } |
|
54 |
|
55 // Returns the set secure id |
|
56 inline const TSecureId GetOwnerSecureId() const |
|
57 { |
|
58 return iOwnerSecureId; |
|
59 } |
|
60 |
|
61 // Checks if the security check is null |
|
62 inline TBool IsNull() |
|
63 { |
|
64 return (iOwnerSecureId == KNullUidValue); |
|
65 } |
|
66 |
|
67 // overloading comparison operator |
|
68 inline TBool operator==(TLbtSecurityPolicy& aSecurityPolicy) |
|
69 { |
|
70 return ( iOwnerSecureId == aSecurityPolicy.GetOwnerSecureId() ); |
|
71 } |
|
72 |
|
73 // overloading assignment operator |
|
74 inline void operator=(TLbtSecurityPolicy& aSecurityPolicy) |
|
75 { |
|
76 iOwnerSecureId = aSecurityPolicy.GetOwnerSecureId(); |
|
77 } |
|
78 |
|
79 // returns a null security policy |
|
80 static inline TLbtSecurityPolicy Null() |
|
81 { |
|
82 TLbtSecurityPolicy security; |
|
83 return security; |
|
84 } |
|
85 |
|
86 private: |
|
87 // Secure id of the trigger owner |
|
88 TSecureId iOwnerSecureId; |
|
89 }; |
|
90 |
|
91 // Null security policy. |
|
92 #define KLbtNullSecurity TLbtSecurityPolicy::Null() |
|
93 |
|
94 #endif //LBTSECURITYPOLICY |
|
95 |
|
96 // end of file |
|
97 |