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

FOGL-8760 permissions optional support added in configuration Manager along with restrictions on configuration update API #1411

Merged
merged 13 commits into from
Jul 8, 2024

Conversation

ashish-jabble
Copy link
Member

No description provided.

Signed-off-by: ashish-jabble <ashish@dianomic.com>
…KV pair

Signed-off-by: ashish-jabble <ashish@dianomic.com>
Signed-off-by: ashish-jabble <ashish@dianomic.com>
… type

Signed-off-by: ashish-jabble <ashish@dianomic.com>
Signed-off-by: ashish-jabble <ashish@dianomic.com>
Signed-off-by: ashish-jabble <ashish@dianomic.com>
…ged in user type is not given in the list of permission; also updated unit tests

Signed-off-by: ashish-jabble <ashish@dianomic.com>
@ashish-jabble ashish-jabble requested a review from MarkRiddoch July 3, 2024 09:08
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/services/core/api/configuration.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
python/fledge/common/configuration_manager.py Outdated Show resolved Hide resolved
if not request.user_is_admin:
if 'permission' in cat_info[item_name]:
if not (user_role_name in cat_info[item_name]['permission']):
raise Exception('Forbidden')
Copy link
Member

Choose a reason for hiding this comment

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

Better to add a know exception custom class, AccessDenied or PermissionDenied and handle that instead of string match

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it was planned but this exception actually to be defined in user model but Not in configuration manager; due to avoid of circular dependency issue, I have kept it under general exception having message Forbidden to get the actual HTTP status code.

Signed-off-by: ashish-jabble <ashish@dianomic.com>
@ashish-jabble ashish-jabble changed the title FOGL-8760 Permission optional support added in configuration Manager along with restrictions on Update API FOGL-8760 permissions optional support added in configuration Manager along with restrictions on configuration update API Jul 5, 2024
@ashish-jabble ashish-jabble merged commit 4af18f8 into develop Jul 8, 2024
3 checks passed
@ashish-jabble ashish-jabble deleted the FOGL-8760 branch July 8, 2024 11:32
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.

3 participants