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
Add policies layer in between roles and permissions #2495
Conversation
org: OrganizationInterface, | ||
teams: TeamInterface[], | ||
id: string | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll want to add one more check - to prevent deleting a role that is the org's default.
// Make sure the id isn't the org's default
if (org.settings?.defaultRole?.role === id) {
throw new Error(
"Cannot delete role. This role is set as the organization's default role."
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this in this PR here, so we don't need to do it here - https://github.com/growthbook/growthbook/pull/2512/files#diff-d577f6ec2e9cc31ebc7af8b716ca1deeffe215e114c4ad0f8f98eef0dde9d404
I've been testing this alongside the UI PR here and it's working great. In the PR above I made two small tweaks.
|
Your preview environment pr-2495-bttf has been deployed. Preview environment endpoints are available at: |
I can't approve since I made the PR, but this looks good to me. |
Features and Changes
Add a "policies" layer in between roles and permissions.
TODO: