Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(roles/org-permission): Add missing viewset #2495

Merged
merged 4 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/api-deploy-production-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
flagsmith_saml_revision: v1.1.0
flagsmith_workflows_revision: v1.2.4
flagsmith_auth_controller_revision: v0.0.1
flagsmith_rbac_revision: v0.1.2
flagsmith_rbac_revision: v0.2.0

- name: Deploy task processor to Production
uses: ./.github/actions/task-processor-deploy-ecs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-deploy-staging-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
flagsmith_saml_revision: v1.1.0
flagsmith_workflows_revision: v1.2.4
flagsmith_auth_controller_revision: v0.0.1
flagsmith_rbac_revision: v0.1.2
flagsmith_rbac_revision: v0.2.0

- name: Deploy task processor to Staging
uses: ./.github/actions/task-processor-deploy-ecs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
FLAGSMITH_SAML_REVISION: v1.1.0
FLAGSMITH_RBAC_REVISION: v0.1.2
FLAGSMITH_RBAC_REVISION: v0.2.0
FLAGSMITH_WORKFLOWS_REVISION: v1.2.4

jobs:
Expand Down
18 changes: 9 additions & 9 deletions api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,25 +309,30 @@ def master_api_key_client(master_api_key):


@pytest.fixture()
def view_environment_permission():
def view_environment_permission(db):
return PermissionModel.objects.get(key=VIEW_ENVIRONMENT)


@pytest.fixture()
def manage_identities_permission():
def manage_identities_permission(db):
return PermissionModel.objects.get(key=MANAGE_IDENTITIES)


@pytest.fixture()
def view_identities_permission():
def view_identities_permission(db):
return PermissionModel.objects.get(key=VIEW_IDENTITIES)


@pytest.fixture()
def view_project_permission():
def view_project_permission(db):
return PermissionModel.objects.get(key=VIEW_PROJECT)


@pytest.fixture()
def create_project_permission(db):
return PermissionModel.objects.get(key=CREATE_PROJECT)


@pytest.fixture()
def user_environment_permission(test_user, environment):
return UserEnvironmentPermission.objects.create(
Expand Down Expand Up @@ -431,11 +436,6 @@ def project_content_type():
return ContentType.objects.get_for_model(Project)


@pytest.fixture
def create_project_permission(db):
return OrganisationPermissionModel.objects.get(key=CREATE_PROJECT)


@pytest.fixture
def manage_user_group_permission(db):
return OrganisationPermissionModel.objects.get(key=MANAGE_USER_GROUPS)
7 changes: 7 additions & 0 deletions api/organisations/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
from rbac.views import (
GroupRoleViewSet,
RoleEnvironmentPermissionsViewSet,
RoleOrganisationPermissionViewSet,
RoleProjectPermissionsViewSet,
RoleViewSet,
UserRoleViewSet,
Expand All @@ -118,8 +119,14 @@
RoleProjectPermissionsViewSet,
basename="roles-projects-permissions",
)
nested_roles_router.register(
"organisation-permissions",
RoleOrganisationPermissionViewSet,
basename="roles-organisations-permissions",
)
nested_roles_router.register("groups", GroupRoleViewSet, basename="group-roles")
nested_roles_router.register("users", UserRoleViewSet, basename="user-roles")

urlpatterns.extend(
[
url(r"^", include(organisations_router.urls)),
Expand Down