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

Adding Manager Role support #1242

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

BlackDex
Copy link
Collaborator

@BlackDex BlackDex commented Nov 27, 2020

This has been requested a few times (#1136 & #246 & forum), and there already were two
(1:1 duplicate) PR's (#1222 & #1223) which needed some changes and no
followups or further comments unfortunally.

This PR adds two auth headers.

  • ManagerHeaders
    Checks if the user-type is Manager or higher and if the manager is
    part of that collection or not.
  • ManagerHeadersLoose
    Check if the user-type is Manager or higher, but does not check if the
    user is part of the collection, needed for a few features like
    retreiving all the users of an org.

I think this is the safest way to implement this instead of having to
check this within every function which needs this manually.

Also some extra checks if a manager has access to all collections or
just a selection.

fixes #1136

@mvalois
Copy link
Contributor

mvalois commented Nov 30, 2020

which needed some changes and no followups or further comments unfortunately.

Thank you for taking time to implement this need. I tried all my best, but my lack of knowledge of Rust made me rely on more experimented users. I'm building it to try it on my own, and will give you feedback.

This has been requested a few times (dani-garcia#1136 & dani-garcia#246 & forum), and there already were two
(1:1 duplicate) PR's (dani-garcia#1222 & dani-garcia#1223) which needed some changes and no
followups or further comments unfortunally.

This PR adds two auth headers.
- ManagerHeaders
  Checks if the user-type is Manager or higher and if the manager is
part of that collection or not.
- ManagerHeadersLoose
  Check if the user-type is Manager or higher, but does not check if the
user is part of the collection, needed for a few features like
retreiving all the users of an org.

I think this is the safest way to implement this instead of having to
check this within every function which needs this manually.

Also some extra checks if a manager has access to all collections or
just a selection.

fixes dani-garcia#1136
@BlackDex
Copy link
Collaborator Author

BlackDex commented Dec 2, 2020

which needed some changes and no followups or further comments unfortunately.

Thank you for taking time to implement this need. I tried all my best, but my lack of knowledge of Rust made me rely on more experimented users. I'm building it to try it on my own, and will give you feedback.

No problem, i saw the need was there, and had some extra time left.

@BlackDex
Copy link
Collaborator Author

BlackDex commented Dec 2, 2020

@dani-garcia Thx for the note about that query already being done. Changes are applied.

@dani-garcia dani-garcia merged commit d15d24f into dani-garcia:master Dec 8, 2020
@FLX-0x00
Copy link

FLX-0x00 commented Dec 8, 2020

Thanks for the great support!

@BlackDex BlackDex mentioned this pull request Dec 8, 2020
@BlackDex BlackDex deleted the allow-manager-role branch December 15, 2020 11:34
jjlin added a commit to jjlin/vaultwarden that referenced this pull request Jan 27, 2021
The implementation of the `Manager` user type (dani-garcia#1242) introduced a regression
whereby owner/admin users are incorrectly denied access to certain collection
APIs if their access control for collections isn't set to "access all".

Owner/admin users should always have full access to collection APIs, per
https://bitwarden.com/help/article/user-types-access-control/#access-control:

> Assigning Admins and Owners to Collections via Access Control will only
> impact which Collections appear readily in the Filters section of their
> Vault. Admins and Owners will always be able to access "un-assigned"
> Collections via the Organization view.
Koisell pushed a commit to Koisell/vaultwarden that referenced this pull request Feb 17, 2021
The implementation of the `Manager` user type (dani-garcia#1242) introduced a regression
whereby owner/admin users are incorrectly denied access to certain collection
APIs if their access control for collections isn't set to "access all".

Owner/admin users should always have full access to collection APIs, per
https://bitwarden.com/help/article/user-types-access-control/#access-control:

> Assigning Admins and Owners to Collections via Access Control will only
> impact which Collections appear readily in the Filters section of their
> Vault. Admins and Owners will always be able to access "un-assigned"
> Collections via the Organization view.
thelittlefireman pushed a commit to thelittlefireman/bitwarden_rs that referenced this pull request Mar 19, 2021
thelittlefireman pushed a commit to thelittlefireman/bitwarden_rs that referenced this pull request Mar 19, 2021
The implementation of the `Manager` user type (dani-garcia#1242) introduced a regression
whereby owner/admin users are incorrectly denied access to certain collection
APIs if their access control for collections isn't set to "access all".

Owner/admin users should always have full access to collection APIs, per
https://bitwarden.com/help/article/user-types-access-control/#access-control:

> Assigning Admins and Owners to Collections via Access Control will only
> impact which Collections appear readily in the Filters section of their
> Vault. Admins and Owners will always be able to access "un-assigned"
> Collections via the Organization view.

Signed-off-by: thelittlefireman <[email protected]>
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.

Org managers can't create or manage collections
4 participants