Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QuerySets: filter permissions by organizations (#8298)
* QuerySets: filter permissions by organizations With the aim to bring logic from .com to .org more closer I'm moving the organization's filters to .org. They are going to be used if `RTD_ALLOW_ORGANIZATIONS` is True, but they eventually will be merged with the current querysets when organizations and normal projects are supported in .org. In .com we are relying on user.projects having the the projects where the user is member of and organization owner (we are syncing this with signals). We don't rely on that hack anymore and always check from the organization models. The signals won't be removed for now, but shouldn't be needed anymore. To re-use more code I have brought the SSO concept here, but isn't implemented yet, we can bring the SSO models and logic later easily. This could be seen as more queries, but the main ones were already being executed in .com. The other ones are executed only when using the API V2, so I don't think that would be a problem. I started this refactor using a mixin, but then we would need to override every single queryset in .com, using composition only requires one override (already used), and doesn't bring other methods into the class.
- Loading branch information
Showing
5 changed files
with
130 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters