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

feat(sdf): Protect Admin Routes behind a new Administer role #5007

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Nov 20, 2024

We have an admin page controlled by a feature flag. We locked the API endpoints down to be those with systeminit.com emails, but we want to take advantage of spicedb to make this work correctly

Even if a user gets to the WorkspaceAdmin page, we have locked down all of the API endpoints for them based on a new role in spicedb

This role will be manually granted and can be done so using the following Zed cli command:

zed relationship create system:system admin administer:<user_pk>

This will be granted by TechOps on the SystemInitiative users that need access to it so that it can be tracked correctly

We have an admin page controlled by a feature flag. We locked the API endpoints down to be those with systeminit.com emails, but we want to take advantage of spicedb to make this work correctly

Even if a user gets to the WorkspaceAdmin page, we have locked down all of the API endpoints for them based on a new role in spicedb

This role will be manually granted and can be done so using the following Zed cli command:

```
zed relationship create system:system admin administer:<user_pk>
```

This will be granted by TechOps on the SystemInitiative users that need access to it so that it can be tracked correctly
@github-actions github-actions bot added the A-sdf Area: Primary backend API service [Rust] label Nov 20, 2024
}

#[derive(Clone, Copy, strum::Display, Debug)]
#[strum(serialize_all = "snake_case")]
pub enum Relation {
Approver,
Owner,
Admin,
Copy link
Contributor

Choose a reason for hiding this comment

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

You know - I actually wonder if owner can also just work here. Only it'd be owner of the system vs the workspace

@@ -206,6 +209,10 @@ impl PermissionBuilder {
self.object(ObjectType::Workspace, id)
}

pub fn system_object(self) -> Self {
self.object(ObjectType::System, "system")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we ever want different permission sets for different systems? Maybe this should be "sdf"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdf Area: Primary backend API service [Rust]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants