mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
AAP-47283 [2.6] Unified display of RBAC & synchronization (#7001)
* Working branch for testing DAB RBAC changes * AAP-48392 Handle DAB RBAC either before or after new type model (for merge) (#16045) * Handle DAB RBAC either before or after new type model * Translate CT to DAB CT * Fix for rearrangement of post_migration methods * Directly include RBAC service URLs * Add a run before remote permission additions * Sync old rbac to remote rbac (#7025) Signed-off-by: Seth Foster <fosterbseth@gmail.com> * Set DAB requirement back to devel --------- Signed-off-by: Seth Foster <fosterbseth@gmail.com> Co-authored-by: Seth Foster <fosterseth@users.noreply.github.com>
This commit is contained in:
committed by
thedoubl3j
parent
a3f2401740
commit
c5fb0c351d
@@ -18,6 +18,7 @@ import pytest
|
||||
from ansible.module_utils.six import raise_from
|
||||
|
||||
from ansible_base.rbac.models import RoleDefinition, DABPermission
|
||||
from ansible_base.rbac import permission_registry
|
||||
from awx.main.tests.functional.conftest import _request
|
||||
from awx.main.tests.functional.conftest import credentialtype_scm, credentialtype_ssh # noqa: F401; pylint: disable=unused-import
|
||||
from awx.main.models import (
|
||||
@@ -36,7 +37,6 @@ from awx.main.models import (
|
||||
)
|
||||
|
||||
from django.db import transaction
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
|
||||
HAS_TOWER_CLI = False
|
||||
@@ -341,7 +341,7 @@ def notification_template(organization):
|
||||
|
||||
@pytest.fixture
|
||||
def job_template_role_definition():
|
||||
rd = RoleDefinition.objects.create(name='test_view_jt', content_type=ContentType.objects.get_for_model(JobTemplate))
|
||||
rd = RoleDefinition.objects.create(name='test_view_jt', content_type=permission_registry.content_type_model.objects.get_for_model(JobTemplate))
|
||||
permission_codenames = ['view_jobtemplate', 'execute_jobtemplate']
|
||||
permissions = DABPermission.objects.filter(codename__in=permission_codenames)
|
||||
rd.permissions.add(*permissions)
|
||||
|
||||
Reference in New Issue
Block a user