mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 20:32:11 +00:00
Refactoring of the Access Table
This commit does a lot of the work of refactoring the access table in a table with id's instead of strings. The result does compile, but has not been tested. It may eat your kittens.
This commit is contained in:
parent
2804784df9
commit
0a4cda0dd4
12 changed files with 246 additions and 733 deletions
|
@ -165,14 +165,14 @@ func NewTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) {
|
|||
}
|
||||
|
||||
// Validate permission level.
|
||||
var auth models.AuthorizeType
|
||||
var auth models.AccessMode
|
||||
switch form.Permission {
|
||||
case "read":
|
||||
auth = models.ORG_READABLE
|
||||
auth = models.ReadAccess
|
||||
case "write":
|
||||
auth = models.ORG_WRITABLE
|
||||
auth = models.WriteAccess
|
||||
case "admin":
|
||||
auth = models.ORG_ADMIN
|
||||
auth = models.AdminAccess
|
||||
default:
|
||||
ctx.Error(401)
|
||||
return
|
||||
|
@ -246,14 +246,14 @@ func EditTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) {
|
|||
isAuthChanged := false
|
||||
if !t.IsOwnerTeam() {
|
||||
// Validate permission level.
|
||||
var auth models.AuthorizeType
|
||||
var auth models.AccessMode
|
||||
switch form.Permission {
|
||||
case "read":
|
||||
auth = models.ORG_READABLE
|
||||
auth = models.ReadAccess
|
||||
case "write":
|
||||
auth = models.ORG_WRITABLE
|
||||
auth = models.WriteAccess
|
||||
case "admin":
|
||||
auth = models.ORG_ADMIN
|
||||
auth = models.AdminAccess
|
||||
default:
|
||||
ctx.Error(401)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue