forked from forgejo/forgejo
Move access and repo permission to models/perm/access (#19350)
* Move access and repo permission to models/perm/access * Remove unnecessary code
This commit is contained in:
parent
8e8e936ada
commit
cbd45471b1
72 changed files with 608 additions and 511 deletions
|
@ -833,7 +833,7 @@ func Collaboration(ctx *context.Context) {
|
|||
ctx.Data["Title"] = ctx.Tr("repo.settings")
|
||||
ctx.Data["PageIsSettingsCollaboration"] = true
|
||||
|
||||
users, err := models.GetCollaborators(ctx.Repo.Repository.ID, db.ListOptions{})
|
||||
users, err := repo_model.GetCollaborators(ctx, ctx.Repo.Repository.ID, db.ListOptions{})
|
||||
if err != nil {
|
||||
ctx.ServerError("GetCollaborators", err)
|
||||
return
|
||||
|
@ -887,7 +887,7 @@ func CollaborationPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if got, err := models.IsCollaborator(ctx.Repo.Repository.ID, u.ID); err == nil && got {
|
||||
if got, err := repo_model.IsCollaborator(ctx, ctx.Repo.Repository.ID, u.ID); err == nil && got {
|
||||
ctx.Flash.Error(ctx.Tr("repo.settings.add_collaborator_duplicate"))
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")
|
||||
return
|
||||
|
@ -908,7 +908,7 @@ func CollaborationPost(ctx *context.Context) {
|
|||
|
||||
// ChangeCollaborationAccessMode response for changing access of a collaboration
|
||||
func ChangeCollaborationAccessMode(ctx *context.Context) {
|
||||
if err := models.ChangeCollaborationAccessMode(
|
||||
if err := repo_model.ChangeCollaborationAccessMode(
|
||||
ctx.Repo.Repository,
|
||||
ctx.FormInt64("uid"),
|
||||
perm.AccessMode(ctx.FormInt("mode"))); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue