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, )
def test_disable_rls_with_superuser_policy(self): disable_row_level_security('tests', 'RestrictedModel', apps, superuser=True)
def test_disable_fails_when_rls_not_enabled(self): with self.assertRaises(ProgrammingError): disable_row_level_security('tests', 'RelatedModel', apps)
def test_disable_rls(self): disable_row_level_security('tests', 'RestrictedModel', apps) enable_row_level_security('tests', 'RestrictedModel', apps)
def test_enable_rls(self): enable_row_level_security('tests', 'RelatedModel', apps) disable_row_level_security('tests', 'RelatedModel', apps)