Add mock of admin area
This commit is contained in:
parent
7ea66dc02e
commit
ec8b7b7db9
3 changed files with 388 additions and 0 deletions
22
sync/sudo.go
Normal file
22
sync/sudo.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package sync
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/enums"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
)
|
||||
|
||||
type contentSudo struct{}
|
||||
|
||||
func getSudo(ctx context.Context, user *models.User) (string, interface{}, *errorWithStatus) {
|
||||
if user.Role != enums.UserroleRoot {
|
||||
return "", nil, &errorWithStatus{
|
||||
Message: "You have to be a root user to access this",
|
||||
Status: http.StatusForbidden,
|
||||
}
|
||||
}
|
||||
content := contentAdminDash{}
|
||||
return "sync/sudo.html", content, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue