-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: remove staff access in courses for catalog views #37
feat: remove staff access in courses for catalog views #37
Conversation
c9d46af
to
1fbf18c
Compare
@@ -394,7 +394,6 @@ def can_see_in_catalog(): | |||
""" | |||
return ( | |||
_has_catalog_visibility(courselike, CATALOG_VISIBILITY_CATALOG_AND_ABOUT) | |||
or _has_staff_access_to_descriptor(user, courselike, courselike.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of removing this, could you add a feature flag inside the _has_staff_access_to_descriptor method that allows to keep standard and custom behavior ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I could add a feature flag, but I only want to change can_see_in_catalog
. I don't want to affect many other places where the staff could have permission.
Do you agree to add the feature flag only here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't forget to update the migration file
This is controversial, but simple. To do this in a monkey patch is a bigger task and also with more work. Is different due the change is in a nested function. Anyway the alternative is to monkeyPatch the _dispatch method and handle there. But its risky and also that method manage other permission with different ways.
This reverts commit 1fbf18c.
7faf860
to
a29df93
Compare
Description
This is controversial, but simple. To do this in custom eox-nelp with a monkey patch is a bigger task and also with more work and risk. Is different due the change is in a nested function. Anyway the alternative is to monkeyPatch the
_dispatch
method and handle there. But its risky and also that method manage other permission with different ways.Testing instructions
HIde a course in studio and check that for anonymous_user doesn't load but for staff general yes.
Before
staff
anonymous_user
After
staff
anonymous_user
Other information
Jira Story: