-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Changes required for APIv3 in corporate #6489
Conversation
Move out the logic that authorize a user hitting /projects/ and create a different class for this (it's used in corporate as well). Leave the PublicDetailPrivateListing class only with the needed logic for this goal: detail access is public and listing access is private.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is blocked. I'm waiting for organization being migrated to .org. |
…humitos/apiv3-corporate
- /organizations/: list all the organizations for the logged in user - /organizations/<organization-slug>/: details of organization - /organizations/<organization-slug/projects/: projects for the organization Note that these URLs are not enabled yet. They are registered in corporate for now until we enable organizations in community.
I think this could be reviewed soon. I don't expect to too much big changes. |
By using `or` instead of `any` we return True immediately if the first condition is True without calling `PublicDetailPrivateListing`. This avoid generating 404 exception because there is not project found on /projects/ URL
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
…humitos/apiv3-corporate
…humitos/apiv3-corporate
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.
LGTM
This PR makes changes required in .org to make it possible to use APIv3 in corporate by extending some permission classes.
There main changes are:
PublicDetailPrivateListing
permission class: move out the logic that checks for a user accessing/projects/
(without a project slug) to list all their projectsCommonPermissions
class that can be overriden from corporate: we can't use theSettingsOverrideObject
pattern withAPIv3Settings
because view classes inherit from it and so, all the classes will have the_default_class
and will be overriden.Organization
(don't enable the URLs in community) and make them extendable from corporateI'm not super happy with 2) but I'm not sure what other pattern we can use to make it more extensible. With my proposal here, any change we need to do in
APIv3Settings
for corporate will need another override or a setting or similar.