Documentation ¶
Index ¶
- Constants
- func AuthGlobalAdmin(fieldAdmin string) string
- func ToSnakeCase(str string) string
- type AuthorizationBuilder
- func (o *AuthorizationBuilder) AuthFieldFor(role string) string
- func (o *AuthorizationBuilder) CreateRule() string
- func (o *AuthorizationBuilder) DeleteRule() string
- func (o *AuthorizationBuilder) Init()
- func (o *AuthorizationBuilder) ListRule() string
- func (o *AuthorizationBuilder) UpdateRule() (ret string)
- func (o *AuthorizationBuilder) ViewRule() string
- type ColBase
- type ColBaseAuth
- type Collection
- type Env
- type User
- type Users
Constants ¶
View Source
const FieldAdmin = "admin"
View Source
const UsersCollName = "users"
View Source
const UsersFieldAvatar = "avatar"
View Source
const UsersFieldEmail = "email"
View Source
const UsersFieldName = "name"
View Source
const UsersFieldUsername = "username"
Variables ¶
This section is empty.
Functions ¶
func AuthGlobalAdmin ¶
func ToSnakeCase ¶
Types ¶
type AuthorizationBuilder ¶
type AuthorizationBuilder struct { CollectionName string FieldKey string CollectionUsers string CollectionUsersFieldAdmin string Roles []string AuthGlobalAdmin string AuthLoggedIn string // contains filtered or unexported fields }
func NewAuthorizationBuilder ¶
func NewAuthorizationBuilder(collectionName string, fieldKey string, roles []string) (ret *AuthorizationBuilder)
func (*AuthorizationBuilder) AuthFieldFor ¶
func (o *AuthorizationBuilder) AuthFieldFor(role string) string
func (*AuthorizationBuilder) CreateRule ¶
func (o *AuthorizationBuilder) CreateRule() string
func (*AuthorizationBuilder) DeleteRule ¶
func (o *AuthorizationBuilder) DeleteRule() string
func (*AuthorizationBuilder) Init ¶
func (o *AuthorizationBuilder) Init()
func (*AuthorizationBuilder) ListRule ¶
func (o *AuthorizationBuilder) ListRule() string
func (*AuthorizationBuilder) UpdateRule ¶
func (o *AuthorizationBuilder) UpdateRule() (ret string)
func (*AuthorizationBuilder) ViewRule ¶
func (o *AuthorizationBuilder) ViewRule() string
type ColBaseAuth ¶
type ColBaseAuth struct { *ColBase UsersColId string AuthBuilder *AuthorizationBuilder }
func NewCollectionBaseAuth ¶
func (*ColBaseAuth) CheckOrInit ¶
func (db *ColBaseAuth) CheckOrInit() (ret bool, err error)
type Collection ¶
Click to show internal directories.
Click to hide internal directories.