Skip to content

Commit

Permalink
fix(roles/org-permission): Add missing viewset (#2495)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi authored Jul 25, 2023
1 parent f7f6a7f commit 2b56c7c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
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

3 comments on commit 2b56c7c

@vercel
Copy link

@vercel vercel bot commented on 2b56c7c Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-flagsmith.vercel.app
docs-flagsmith.vercel.app
docs.bullet-train.io
docs.flagsmith.com

@vercel
Copy link

@vercel vercel bot commented on 2b56c7c Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 2b56c7c Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.