-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support Manager role #1223
Support Manager role #1223
Conversation
This is just a copy of the recently closed PR #1222 which noted that there probably should be a better way to do this. |
You mean it is possible not to add any extra line in |
Yes, there is. You probably need to do these checks in auth.rs, and when thinking about it and checking your changes, there are also some cases where you have access as a Manager, but there is no collection_id provided. But those items you want to have checked before they enter the function at all i think. Also, i see some other issues like always saving the CollectionUser, which should not be done when the user as access to all collections. And i'm missing some function, like changing a collection name. |
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.
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
Going to close this PR as #1242 has been merged :). |
Thank you for your time! |
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
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
Wanna fix #1136
This is my first time with Rust. Feel free to ask for changes (especially for error handling).
Maybe the function
check_manager_in_collection
can be moved to a better spot.