commit/galaxy-central: greg: Enhance the tool shed security agent to enable restriction of component reviews that have been marked private.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/a239f666d5ba/ changeset: a239f666d5ba user: greg date: 2012-10-24 17:26:00 summary: Enhance the tool shed security agent to enable restriction of component reviews that have been marked private. affected #: 1 file diff -r 409fec0598f944d30f69e9faaac193b71d6541b8 -r a239f666d5ba8ce3f24198e7054fdd03ab60ada0 lib/galaxy/webapps/community/security/__init__.py --- a/lib/galaxy/webapps/community/security/__init__.py +++ b/lib/galaxy/webapps/community/security/__init__.py @@ -170,6 +170,21 @@ repository_reviewer_role = self.get_repository_reviewer_role() return repository_reviewer_role and repository_reviewer_role in roles return False + def user_can_browse_component_review( self, component_review, user ): + if component_review and user: + if component_review.private: + if self.user_can_review_repositories( user ): + # Reviewers can access private component reviews. + return True + repository_review = component_review.repository_review + repository = repository_review.repository + if repository.user == user: + # The repository owner can access private component reviews. + return True + return False + # The component_review is not marked private. + return True + return False def get_permitted_actions( filter=None ): '''Utility method to return a subset of RBACAgent's permitted actions''' Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket