406 self.assertRaises(Unauthorized, cnx.commit) |
406 self.assertRaises(Unauthorized, cnx.commit) |
407 cnx.execute('SET X test TRUE WHERE X eid %(x)s', {'x': eid}) |
407 cnx.execute('SET X test TRUE WHERE X eid %(x)s', {'x': eid}) |
408 self.assertRaises(Unauthorized, cnx.commit) |
408 self.assertRaises(Unauthorized, cnx.commit) |
409 cnx.execute('SET X web "http://www.logilab.org" WHERE X eid %(x)s', {'x': eid}) |
409 cnx.execute('SET X web "http://www.logilab.org" WHERE X eid %(x)s', {'x': eid}) |
410 cnx.commit() |
410 cnx.commit() |
|
411 with self.new_access('iaminusersgrouponly').repo_cnx() as cnx: |
|
412 cnx.execute('INSERT Frozable F: F name "Foo"') |
|
413 cnx.commit() |
|
414 cnx.execute('SET F name "Bar" WHERE F is Frozable') |
|
415 cnx.commit() |
|
416 cnx.execute('SET F name "BaBar" WHERE F is Frozable') |
|
417 cnx.execute('SET F frozen True WHERE F is Frozable') |
|
418 with self.assertRaises(Unauthorized): |
|
419 cnx.commit() |
|
420 cnx.rollback() |
|
421 cnx.execute('SET F frozen True WHERE F is Frozable') |
|
422 cnx.commit() |
|
423 cnx.execute('SET F name "Bar" WHERE F is Frozable') |
|
424 with self.assertRaises(Unauthorized): |
|
425 cnx.commit() |
411 |
426 |
412 def test_attribute_security_rqlexpr(self): |
427 def test_attribute_security_rqlexpr(self): |
413 with self.admin_access.repo_cnx() as cnx: |
428 with self.admin_access.repo_cnx() as cnx: |
414 # Note.para attribute editable by managers or if the note is in "todo" state |
429 # Note.para attribute editable by managers or if the note is in "todo" state |
415 note = cnx.execute("INSERT Note X: X para 'bidule'").get_entity(0, 0) |
430 note = cnx.execute("INSERT Note X: X para 'bidule'").get_entity(0, 0) |