Documentation
¶
Index ¶
- func AddGroupingPolicy(fieldValues ...interface{}) error
- func AddPolicy(fieldValues ...interface{}) error
- func Authenticate() gin.HandlerFunc
- func Authorize(obj string, act string) gin.HandlerFunc
- func CreatePolicy(c *gin.Context)
- func DeletePolicy(c *gin.Context)
- func Enforce(fieldValues ...interface{}) (bool, error)
- func GenerateJWT(id uint) (string, error)
- func GetFilteredPolicy(fieldIndex int, fieldValues ...string) ([][]string, error)
- func GetPolicy(c *gin.Context)
- func GetSubjectGroups(sub string) ([][]string, error)
- func GetSubjectPolicies(sub string) ([][]string, error)
- func Init(gormDb *gorm.DB, s interface{})
- func ListPolicies(c *gin.Context)
- func RemovePolicy(fieldValues ...interface{}) error
- func UpdatePolicy(c *gin.Context)
- type Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGroupingPolicy ¶ added in v1.1.0
func AddGroupingPolicy(fieldValues ...interface{}) error
func Authenticate ¶
func Authenticate() gin.HandlerFunc
func GenerateJWT ¶
func GetFilteredPolicy ¶ added in v1.1.0
func GetSubjectGroups ¶ added in v1.1.0
func GetSubjectPolicies ¶ added in v1.1.0
func RemovePolicy ¶
func RemovePolicy(fieldValues ...interface{}) error
Types ¶
type Policy ¶ added in v1.1.0
type Policy struct {
ID uint `gorm:"primaryKey" json:"id"`
Ptype string `gorm:"size:100;not null" json:"ptype"`
V0 string `gorm:"size:100;not null" json:"v0"`
V1 string `gorm:"size:100;not null" json:"v1"`
V2 string `gorm:"size:100;not null" json:"v2"`
V3 string `gorm:"size:100;not null" json:"v3"`
V4 string `gorm:"size:100;not null" json:"v4"`
V5 string `gorm:"size:100;not null" json:"v5"`
}
Click to show internal directories.
Click to hide internal directories.