|
@@ -11,8 +11,8 @@ class can_read(Predicate):
|
11
|
11
|
pass
|
12
|
12
|
|
13
|
13
|
def evaluate(self, environ, credentials):
|
14
|
|
- if 'node' in environ['webob.adhoc_attrs']['validation']['values']:
|
15
|
|
- node_id = environ['webob.adhoc_attrs']['validation']['values']['node']
|
|
14
|
+ if 'node_id' in environ['webob.adhoc_attrs']['validation']['values']:
|
|
15
|
+ node_id = environ['webob.adhoc_attrs']['validation']['values']['node_id']
|
16
|
16
|
if node_id!=0:
|
17
|
17
|
has_right = session.execute("""
|
18
|
18
|
select *
|
|
@@ -32,15 +32,17 @@ class can_write(Predicate):
|
32
|
32
|
pass
|
33
|
33
|
|
34
|
34
|
def evaluate(self, environ, credentials):
|
35
|
|
- node_id = environ['webob.adhoc_attrs']['validation']['values']['node_id']
|
36
|
|
- has_right = session.execute("""
|
37
|
|
- select *
|
38
|
|
- from pod_group_node pgn
|
39
|
|
- join pod_user_group pug on pug.group_id = pgn.group_id
|
40
|
|
- join pod_user pu on pug.user_id = pu.user_id
|
41
|
|
- where rights > 1
|
42
|
|
- and email_address = :mail
|
43
|
|
- and node_id = :node""", {"mail":credentials["repoze.who.userid"], "node":node_id})
|
44
|
|
- if has_right.rowcount == 0 :
|
45
|
|
- self.unmet()
|
|
35
|
+ if 'node_id' in environ['webob.adhoc_attrs']['validation']['values']:
|
|
36
|
+ node_id = environ['webob.adhoc_attrs']['validation']['values']['node_id']
|
|
37
|
+ if node_id!=0:
|
|
38
|
+ has_right = session.execute("""
|
|
39
|
+ select *
|
|
40
|
+ from pod_group_node pgn
|
|
41
|
+ join pod_user_group pug on pug.group_id = pgn.group_id
|
|
42
|
+ join pod_user pu on pug.user_id = pu.user_id
|
|
43
|
+ where rights > 1
|
|
44
|
+ and email_address = :mail
|
|
45
|
+ and node_id = :node""", {"mail":credentials["repoze.who.userid"], "node":node_id})
|
|
46
|
+ if has_right.rowcount == 0 :
|
|
47
|
+ self.unmet()
|
46
|
48
|
|