File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,14 @@ def name(self):
363
363
self .info ()
364
364
return self ._name
365
365
366
+ @property
367
+ def security (self ):
368
+ return self .resource .get_json ('_security' )[2 ]
369
+
370
+ @security .setter
371
+ def security (self , doc ):
372
+ self .resource .put_json ('_security' , body = doc )
373
+
366
374
def create (self , data ):
367
375
"""Create a new document in the database with a random ID that is
368
376
generated by the server.
Original file line number Diff line number Diff line change @@ -483,6 +483,12 @@ def test_json_encoding_error(self):
483
483
doc = {'now' : datetime .now ()}
484
484
self .assertRaises (TypeError , self .db .save , doc )
485
485
486
+ def test_security (self ):
487
+ security = self .db .security
488
+ self .assertEqual (security , {})
489
+ security ['members' ] = {'names' : ['test' ], 'roles' : []}
490
+ self .db .security = security
491
+
486
492
487
493
class ViewTestCase (testutil .TempDatabaseMixin , unittest .TestCase ):
488
494
You can’t perform that action at this time.
0 commit comments