Skip to content

Conversation

akhilmhdh
Copy link
Member

Description 📣

Completed namespace first part of phase 1 which is the access management

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@maidul98
Copy link
Collaborator

maidul98 commented Sep 23, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link
Contributor

@scott-ray-wilson scott-ray-wilson left a comment

Choose a reason for hiding this comment

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

first batch of comments

Comment on lines 60 to 70
await knex.schema.createTable(TableName.NamespaceRole, (t) => {
t.uuid("id").primary().defaultTo(knex.fn.uuid());
t.string("name").notNullable();
t.string("description");
t.string("slug").notNullable();
t.jsonb("permissions").notNullable();
t.uuid("namespaceId").notNullable();
t.foreign("namespaceId").references("id").inTable(TableName.Namespace).onDelete("CASCADE");
t.timestamps(true, true, true);
t.unique(["name", "namespaceId"]);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were moving away from slugs? or is this to keep consistency with org/project roles?

If so, shouldn't the unique be on slug and not name?

Copy link
Member Author

Choose a reason for hiding this comment

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

FIxed and yes it's for keeping it similiar in all sides

name: "",
slug: "",
description: "",
permissions: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

issue with creating namespace role being blocked by permission validation error:

slack video link

CleanShot.2025-09-23.at.14.00.11.mp4

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

formName: "role"
},
{
title: "Namespace Profile",
Copy link
Contributor

Choose a reason for hiding this comment

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

feel like this should probably be Namespace Settings? Profile confused me

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm! May be let's discuss this - project permission follows the same convention

Copy link
Contributor

Choose a reason for hiding this comment

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

audit endpoints

});
ForbiddenError.from(namespacePermission).throwUnlessCan(
NamespacePermissionIdentityActions.Edit,
subject(NamespacePermissionSubjects.Identity, { identityId })
Copy link
Contributor

Choose a reason for hiding this comment

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

not related to this line in particular but just pointing out that the UI for namespace permissions doesn't support conditions like projects
CleanShot 2025-09-23 at 18 38 12@2x


if (identityOrgMembership.identity.namespace)
throw new BadRequestError({
message: `Namespace identity with id ${identityId} membership cannot be deleted`
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extra space in error message


const totalCount = await namespaceIdentityMembershipDAL.getCountByNamespaceId(namespace.id, { search });

return { identityMemberships, totalCount };
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we filter the memberships based off condition permission?

Copy link
Member Author

Choose a reason for hiding this comment

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

Conditions are just not pushed yet. Will hold it as separate part.

namespaceId: namespace.id
});

return { identityMemberships: docs, totalCount };
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing; shouldn't we filter results based off conditional read with id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants