mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 08:57:03 -05:00
added some logs
This commit is contained in:
parent
3dbcf34a16
commit
64abf87fb0
2 changed files with 5 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
// Repository function returns the Repository actor for a repo
|
||||
|
@ -26,6 +27,7 @@ func Repository(ctx *context.APIContext) {
|
|||
// "200":
|
||||
// "$ref": "#/responses/ActivityPub"
|
||||
|
||||
log.Error("Repository")
|
||||
ctx.Status(http.StatusNoContent)
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
// RepositoryIDAssignmentAPI returns a middleware to handle context-repo assignment for api routes
|
||||
|
@ -16,6 +17,8 @@ func RepositoryIDAssignmentAPI() func(ctx *context.APIContext) {
|
|||
// TODO: enough validation for security?
|
||||
repositoryID := ctx.ParamsInt64(":repository-id")
|
||||
|
||||
log.Info("RepositoryIDAssignmentAPI: %v", repositoryID)
|
||||
|
||||
//TODO: check auth here ?
|
||||
if !ctx.Repo.HasAccess() && !ctx.IsUserSiteAdmin() {
|
||||
ctx.Error(http.StatusForbidden, "reqAnyRepoReader", "user should have any permission to read repository or permissions of site admin")
|
||||
|
|
Loading…
Reference in a new issue