mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-13 19:31:51 +02:00
feat: default visibility (#155)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:

committed by
Thomas Miceli

parent
943212e492
commit
246f12c8cb
@ -6,13 +6,6 @@ import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/thomiceli/opengist/internal/db"
|
||||
"github.com/thomiceli/opengist/internal/git"
|
||||
"github.com/thomiceli/opengist/internal/memdb"
|
||||
"gorm.io/gorm"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
@ -21,6 +14,14 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/thomiceli/opengist/internal/db"
|
||||
"github.com/thomiceli/opengist/internal/git"
|
||||
"github.com/thomiceli/opengist/internal/memdb"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var routes = []struct {
|
||||
@ -73,7 +74,7 @@ func gitHttp(ctx echo.Context) error {
|
||||
// - user wants to clone/pull a private gist
|
||||
// - gist is not found (obfuscation)
|
||||
// - admin setting to require login is set to true
|
||||
if isPull && gist.Private != 2 && gist.ID != 0 && !getData(ctx, "RequireLogin").(bool) {
|
||||
if isPull && gist.Private != db.PrivateVisibility && gist.ID != 0 && !getData(ctx, "RequireLogin").(bool) {
|
||||
return route.handler(ctx)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user