Skip to content

Commit

Permalink
fix the problem of private projects
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Feb 11, 2025
1 parent 9b8c627 commit 66dda2d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/projects/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ class ProjectIdResource(Resource):
def get(self, project_name: str):
"""Get a single project"""
project = ProjectService.get_by_name(project_name)
ProjectAccessService.check_admin_access(project.id)
ProjectService.check_if_project_exist(project)
return project
if ProjectAccessService.check_project_access(project.visibility, project.id):
return project
else:
abort(403, 'Access denied to this project')

@responds(schema=ProjectSchema, api=api)
@accepts(schema=ProjectSchema, api=api)
Expand Down

0 comments on commit 66dda2d

Please sign in to comment.