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: Add more granular permissions based on tags #4250

Closed
wants to merge 15 commits into from

Conversation

novakzaballa
Copy link
Contributor

@novakzaballa novakzaballa commented Jun 26, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Based on the issue: #1535

  • Tags can now be added to roles to enhance granularity in permissions.
Screenshot 2024-06-26 at 3 24 26 PM

How did you test this code?

To properly test the functionality, this issue must be resolved first.

  • Go to the "users and permissions" tab
  • Click the "roles" tab
  • Select the project where you have the tags you want to manage.
  • Select the tags, and click save/update button

@novakzaballa novakzaballa requested a review from a team as a code owner June 26, 2024 15:20
@novakzaballa novakzaballa requested review from kyle-ssg and removed request for a team June 26, 2024 15:20
Copy link

vercel bot commented Jun 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 6:46pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 6:46pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 6:46pm

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard feature New feature or request labels Jun 26, 2024
Copy link
Contributor

github-actions bot commented Jun 26, 2024

Uffizzi Preview deployment-55834 was deleted.

<FormGroup className='mb-5 setting'>
<InputGroup
title={'Tags'}
tooltip={'Select the project where you want to manage your tags'}
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks wrong, we need to provide good context here about what adding tags to a role means. Can we link out to some documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added documentation

organisationId={organisationId!}
onChange={(p) => {
setProject(p)
getTags(
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why this is called? seems wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Looking at this more closely, it does look like this is unnecessary. AddEditTags uses useGetTagsQuery.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, removed.

@kyle-ssg
Copy link
Member

kyle-ssg commented Jul 1, 2024

I don't understand what this PR does, what does associating tags to a role do?

image

@kyle-ssg
Copy link
Member

kyle-ssg commented Jul 1, 2024

I think I understand, so this lets us create a role with permissions but just targets a tagged set of flags?

If so I have further questions that are not indicated by this work, apologies if I'm assuming something wrong:

Presumably only certain permissions are affected by the tags that are selected and the rest aren't?

  • If this is the case we need to clearly show what setting these affects, it should be in the permissions tab clearly showing what selecting tags does.

I'm going to assume that this affects Delete feature, Create feature, Update feature state, Create change request and Approve change request?

  • If this is the case, isn't it quite a big assumption that all the permissions are for the same tags? It feels like this should be set for each permission otherwise you'd have to create multiple roles with the same users/groups to achieve what you want.

@kyle-ssg
Copy link
Member

As discussed, let's hide irrelevant things when opting into tag based permissions

image

I think we can hide:

  • The organisation tab
  • Any project in the project tab that isn't the one selected
  • Any project and environment features that aren't relevant, including View environment and View Project

@novakzaballa
Copy link
Contributor Author

I think we can hide:

  • The organisation tab

This tab hides when a tag is saved in the role

  • Any project in the project tab that isn't the one selected

Projects that do not have the same tags as the role should not be displayed.

  • Any project and environment features that aren't relevant, including View environment and View Project

All features that aren't relevant have been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants