Пример #1
0
 def database_backwards(self, app_label: str, schema_editor: SchemaEditor,
                        from_state: ProjectState,
                        to_state: ProjectState) -> None:
     disable_row_level_security(
         app_label,
         self.model_name,
         apps=to_state.apps,
         superuser=self.superuser,
     )
Пример #2
0
 def test_disable_rls_with_superuser_policy(self):
     disable_row_level_security('tests',
                                'RestrictedModel',
                                apps,
                                superuser=True)
Пример #3
0
 def test_disable_fails_when_rls_not_enabled(self):
     with self.assertRaises(ProgrammingError):
         disable_row_level_security('tests', 'RelatedModel', apps)
Пример #4
0
 def test_disable_rls(self):
     disable_row_level_security('tests', 'RestrictedModel', apps)
     enable_row_level_security('tests', 'RestrictedModel', apps)
Пример #5
0
 def test_enable_rls(self):
     enable_row_level_security('tests', 'RelatedModel', apps)
     disable_row_level_security('tests', 'RelatedModel', apps)