Flagsmith / flagsmith

Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
4.56k stars 345 forks source link

feat: Add more granular permissions based on tags #4250

Open novakzaballa opened 6 days ago

novakzaballa commented 6 days ago

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

Changes

How did you test this code?

vercel[bot] commented 6 days ago

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

Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 8:00pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 8:00pm
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **docs** | ⬜️ Ignored ([Inspect](https://vercel.com/flagsmith/docs/9DgeD6iuEiC6RRS1pHcoMPPAMr5H)) | [Visit Preview](https://docs-git-feat-add-more-granular-permission-flagsmith.vercel.app) | | Jul 2, 2024 8:00pm |
github-actions[bot] commented 6 days ago

Uffizzi Ephemeral Environment deployment-53534

:cloud: https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4250

:page_facing_up: View Application Logs etc.

What is Uffizzi? Learn more!

kyle-ssg commented 1 day ago

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

image

kyle-ssg commented 1 day ago

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?

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

novakzaballa commented 7 hours ago

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.

This PR aims to implement the backend created for this issue, This means that when a feature is tagged, the role to which a user belongs must have the same flag to delete and update a feature.