Skip to content
Snippets Groups Projects
Select Git revision
  • 5c53f359fb37dd0f0120ccd29992a9b9ce6f289f
  • master default protected
  • feature/PRXS-3383-CollectionsSort
  • feature/2781-SpacesLoggingMiddleware
  • feature/PRXS-3421-ImplementNewRefAPI
  • feature/PRXS-3143-3235-ReferenceOptions
  • feature/PRXS-3143-LimitReferenceFields
  • feature/PRXS-3234-FeaturePruneIdents
  • PRXS-3421-RecursiveReferences
  • feature/3109-SerializeFeature
  • release/0.33
  • feature/3109-RecoverySchema
  • feature/3109-feature
  • fix/PRXS-3369-ValidateFields
  • refactor/PRXS-3306-MovePkgGroup1
  • refactor/6-pkg-refactor-expr
  • fix/PRXS-3360-TemplateBuilderPatch
  • feature/3293-MongoV2
  • feature/3272-GoVersionUp
  • feature/PRXS-3218-HideTemplateActions
  • feature/PRXS-3234-PruneIdents
  • v0.33.1
  • v0.32.0
  • v0.31.1
  • v0.31.0
  • v0.30.0
  • v0.29.0
  • v0.28.0
  • v0.27.0-alpha.1+16
  • v0.27.0-alpha.1+15
  • v0.27.0-alpha.1+14
  • v0.27.0-alpha.1+13
  • v0.27.0-alpha.1+12
  • v0.27.0-alpha.1+11
  • v0.27.0-alpha.1+10
  • v0.27.0-alpha.1+9
  • v0.27.0-alpha.1+8
  • v0.27.0-alpha.1+7
  • v0.27.0-alpha.1+6
  • v0.27.0-alpha.1+5
  • v0.27.0-alpha.1+4
41 results

role.go

Blame
  • item.go 19.08 KiB
    package items
    
    import (
    	"context"
    	"fmt"
    	"time"
    
    	"git.perx.ru/perxis/perxis-go/pkg/data"
    	"git.perx.ru/perxis/perxis-go/pkg/errors"
    	"git.perx.ru/perxis/perxis-go/pkg/locales"
    	"git.perx.ru/perxis/perxis-go/pkg/schema"
    	"git.perx.ru/perxis/perxis-go/pkg/schema/field"
    	"git.perx.ru/perxis/perxis-go/pkg/schema/localizer"
    	pb "git.perx.ru/perxis/perxis-go/proto/items"
    	"google.golang.org/protobuf/types/known/structpb"
    	"google.golang.org/protobuf/types/known/timestamppb"
    )
    
    var (
    	ErrNotSystemField = errors.New("not a system field")
    	ErrIncorrectValue = errors.New("incorrect value")
    	ErrIncorrectField = errors.New("incorrect field")
    	ErrReservedField  = errors.New("cannot use reserved field name")
    )
    
    type State int
    
    func (s State) String() string {
    	switch s {
    	case StateDraft:
    		return "Draft"
    	case StateArchived:
    		return "Archived"
    	case StateChanged:
    		return "Changed"
    	case StatePublished:
    		return "Published"
    	}
    	return "Unknown"
    }
    
    const (
    	StateDraft State = iota
    	StatePublished
    	StateChanged
    	StateArchived
    
    	StateMax = StateArchived
    
    	SoftDeleteSeparator = "___"
    )
    
    var PermissionsAllowAny = &Permissions{
    	Edit:       true,
    	Archive:    true,
    	Publish:    true,
    	SoftDelete: true,
    	HardDelete: true,
    }
    
    // SystemFields - системные поля Item
    var SystemFields = []string{
    	"id",
    	"space_id",
    	"env_id",
    	"collection_id",
    	"state",
    	"created_rev_at",
    	"created_by",
    	"created_at",