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

[192988] Fix permissions #3722

Merged
merged 2 commits into from
Mar 27, 2024
Merged

[192988] Fix permissions #3722

merged 2 commits into from
Mar 27, 2024

Conversation

patryk-dabrowski
Copy link
Contributor

@patryk-dabrowski patryk-dabrowski commented Mar 21, 2024

@patryk-dabrowski patryk-dabrowski added bug Something isn't working backend Changes in BE code labels Mar 21, 2024
@patryk-dabrowski patryk-dabrowski self-assigned this Mar 21, 2024
@patryk-dabrowski patryk-dabrowski merged commit 1d5c21b into develop Mar 27, 2024
12 checks passed
@patryk-dabrowski patryk-dabrowski deleted the fix/192988 branch March 27, 2024 11:09
)
else:
return has_program_access and (has_user_roles or has_partner_roles)
return has_user_roles
Copy link
Contributor

Choose a reason for hiding this comment

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

if self.partner.is_unicef:
    has_program_access = True
    has_partner_roles = permission in DEFAULT_PERMISSIONS_LIST_FOR_IS_UNICEF_PARTNER
else:
    has_program_access = str(program_id) in self.get_partner_programs_areas_dict(business_area_id=business_area.pk)
    has_partner_roles = self.cached_has_partner_roles_for_business_area_and_permission(
            business_area=business_area,
            permission=permission,
        )

?
Permission can still originate from partner UNICEF

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UNICEF partner still has access to all programs, but user permissions determine to which business area and which features, in previous implementations in some cases, UNICEF partner had access to all business areas

Copy link
Contributor

Choose a reason for hiding this comment

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

But is it supposed to no longer grant any permissions now? Because right now users under UNICEF partner will not inherit any permissions.
Shouldn't UNICEF partner grant the permissions from the default list for the BAs that user has access to? So if user has access to Afg, but with role that grants only some 1 basic permission, he should have all permissions from UNICEF partner inside this BA, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Changes in BE code bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants