comparison sat_pubsub/error.py @ 349:20b82fb8de02

backend: check nodes/items permission on disco#items: - move node access check workflow from getItemsData to a new checkNodeAccess method - only accessible items are returned to an entity when doing a disco#items on a node - for PEP, nodes with presence access model are not returned if entity has not presence subscription from the node owner - all nodes are returned in normal pubsub service - new NotLeafNodeError exception when an action need to be done on Leaf node and it is not the case - /!\ access it not fully checked : items access models are not handled for items id in disco#items, and whitelist nodes are returned regardless if requestor is in the white list or not. Furthermore, publisher-roster access is not handled for nodes.
author Goffi <goffi@goffi.org>
date Sun, 27 Aug 2017 20:33:39 +0200
parents 5d7c3787672e
children 9fbb31ce495b
comparison
equal deleted inserted replaced
348:d1f63ae1eaf4 349:20b82fb8de02
59 59
60 60
61 def __str__(self): 61 def __str__(self):
62 return self.msg 62 return self.msg
63 63
64
64 class Deprecated(Exception): 65 class Deprecated(Exception):
65 pass 66 pass
66 67
67 68
68 class NodeNotFound(Error): 69 class NodeNotFound(Error):
69 pass 70 pass
70 71
71 72
72
73 class NodeExists(Error): 73 class NodeExists(Error):
74 pass 74 pass
75
76 75
77 76
78 class NotSubscribed(Error): 77 class NotSubscribed(Error):
79 """ 78 """
80 Entity is not subscribed to this node. 79 Entity is not subscribed to this node.
81 """ 80 """
82 81
83 82
84
85 class SubscriptionExists(Error): 83 class SubscriptionExists(Error):
86 """ 84 """
87 There already exists a subscription to this node. 85 There already exists a subscription to this node.
88 """ 86 """
89 87
90 88
89 def NotLeafNodeError(Error):
90 """a leaf node is expected but we have a collection"""
91
91 92
92 class Forbidden(Error): 93 class Forbidden(Error):
93 pass 94 pass
94
95 95
96 96
97 class NotAuthorized(Error): 97 class NotAuthorized(Error):
98 pass 98 pass
99 99
100 100
101
102 class NotInRoster(Error): 101 class NotInRoster(Error):
103 pass 102 pass
104
105 103
106 104
107 class ItemNotFound(Error): 105 class ItemNotFound(Error):
108 pass 106 pass
109 107
110 108
111
112 class ItemForbidden(Error): 109 class ItemForbidden(Error):
113 pass 110 pass
114
115 111
116 112
117 class ItemRequired(Error): 113 class ItemRequired(Error):
118 pass 114 pass
119 115
120 116
121
122 class NoInstantNodes(Error): 117 class NoInstantNodes(Error):
123 pass 118 pass
124
125 119
126 120
127 class InvalidConfigurationOption(Error): 121 class InvalidConfigurationOption(Error):
128 msg = 'Invalid configuration option' 122 msg = 'Invalid configuration option'
129 123
130 124
131
132 class InvalidConfigurationValue(Error): 125 class InvalidConfigurationValue(Error):
133 msg = 'Bad configuration value' 126 msg = 'Bad configuration value'
134
135 127
136 128
137 class NodeNotPersistent(Error): 129 class NodeNotPersistent(Error):
138 pass 130 pass
139 131
140 132
141
142 class NoRootNode(Error): 133 class NoRootNode(Error):
143 pass 134 pass
144
145 135
146 136
147 class NoCallbacks(Error): 137 class NoCallbacks(Error):
148 """ 138 """
149 There are no callbacks for this node. 139 There are no callbacks for this node.
150 """ 140 """
151 141
152
153
154 class NoCollections(Error): 142 class NoCollections(Error):
155 pass 143 pass
156
157 144
158 145
159 class NoPublishing(Error): 146 class NoPublishing(Error):
160 """ 147 """
161 This node does not support publishing. 148 This node does not support publishing.