Skip to content
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

Bugfix/false positive #58

Merged
merged 8 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Currently, performance analysis consists of:

You can see more details about the horusec <a href="assets/horusec-complete-architecture.jpg">/assets/horusec-complete-architecture.jpg</a>

### For more details see our [DOCUMENTATION](https://zup-products.gitbook.io/horusec)

## Project roadmap

We started the project to aggregate within our company, but as the search grew more and more we chose to apply good practices and open it up for everyone to collaborate with this incredible project.
Expand Down
9 changes: 7 additions & 2 deletions development-kit/pkg/services/middlewares/repository_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,13 @@ func (rm *repositoryAuthzMiddleware) IsRepositorySupervisor(next http.Handler) h
repositoryID, _ := uuid.Parse(chi.URLParam(r, "repositoryID"))
accountRepository, err := rm.repoAccountRepository.GetAccountRepository(accountID, repositoryID)
if err != nil || accountRepository.Role != accountEnums.Supervisor && accountRepository.Role != accountEnums.Admin {
httpUtil.StatusForbidden(w, errors.ErrorUnauthorized)
return
companyID, _ := uuid.Parse(chi.URLParam(r, "companyID"))
accountCompany, errCompany := rm.repositoryRepo.GetAccountCompanyRole(accountID, companyID)

if errCompany != nil || accountCompany.Role != accountEnums.Admin {
httpUtil.StatusForbidden(w, errors.ErrorUnauthorized)
return
}
}
next.ServeHTTP(w, r)
})
Expand Down
Loading