Documentation ¶
Overview ¶
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Index ¶
- Variables
- func Check(path string, accounts Accounts) (bool, string)
- func IsAdmin(accounts Accounts) bool
- func SetPermissions(allowDefault bool, ps ...*Permission)
- type Account
- type Accounts
- func (a Accounts) GetByProvider(p string) Accounts
- func (a Accounts) GetByProviderDomain(p string, d string) *Account
- func (a Accounts) Image() string
- func (a Accounts) Images() []string
- func (a Accounts) Matches(match string) bool
- func (a Accounts) Purge(keys ...string) Accounts
- func (a Accounts) Sort()
- func (a Accounts) String() string
- func (a Accounts) TitleString() string
- type Permission
- type Permissions
- type Profile
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultProfile = &Profile{Name: "Guest"}
View Source
var (
PermissionsLogger util.Logger
)
Functions ¶
func SetPermissions ¶
func SetPermissions(allowDefault bool, ps ...*Permission)
Types ¶
type Account ¶
type Account struct { Provider string `json:"provider"` Email string `json:"email"` Picture string `json:"picture"` Token string `json:"-"` }
func (*Account) TitleString ¶ added in v0.2.12
type Accounts ¶
type Accounts []*Account
func AccountsFromString ¶
func (Accounts) GetByProvider ¶
func (Accounts) GetByProviderDomain ¶ added in v0.2.12
func (Accounts) TitleString ¶ added in v0.2.12
type Permission ¶
type Permission struct { Path string `json:"path"` Match string `json:"match"` Allow bool `json:"allow"` }
func (Permission) Matches ¶
func (p Permission) Matches(path string) bool
func (Permission) String ¶
func (p Permission) String() string
type Permissions ¶
type Permissions []*Permission
func GetPermissions ¶
func GetPermissions() Permissions
func (Permissions) Check ¶
func (p Permissions) Check(path string, accounts Accounts) (bool, string)
func (Permissions) Sort ¶
func (p Permissions) Sort()
Click to show internal directories.
Click to hide internal directories.