Documentation ¶
Index ¶
- func AddRelation(db *sql.DB, aid, rid uint32) error
- func AddURLPermission(db *sql.DB, rid uint32, url string) error
- func AdminGetRoleMap(db *sql.DB, aid uint64) (map[uint32]bool, error)
- func CreateRole(db *sql.DB, name, intro *string) error
- func CreateTable(db *sql.DB) error
- func GetAdminIDMap(db *sql.DB) (map[uint32]bool, error)
- func GetRoleIDMap(db *sql.DB) (map[uint32]bool, error)
- func IsActive(db *sql.DB, id uint32) (bool, error)
- func ModifyRole(db *sql.DB, id uint32, name, intro *string) error
- func ModifyRoleActive(db *sql.DB, id uint32, active bool) error
- func Permissions(db *sql.DB) (*[]*Permission, error)
- func RemoveRelation(db *sql.DB, aid, rid uint32) error
- func RemoveURLPermission(db *sql.DB, rid uint32, url string) error
- func URLPermissions(db *sql.DB, url *string) (map[uint32]bool, error)
- type Permission
- type RelationData
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddURLPermission ¶
AddURLPermission -
func AdminGetRoleMap ¶
AdminGetRoleMap list all the roles of the specified admin and the return form is map.
func CreateRole ¶
CreateRole create a new role information.
func GetAdminIDMap ¶
GetAdminIDMap list all the roles of the specified admin and the return form is map.
func GetRoleIDMap ¶
GetRoleIDMap list all the roles of the specified admin and the return form is map.
func ModifyRole ¶
ModifyRole modify role information.
func ModifyRoleActive ¶
ModifyRoleActive modify role active.
func Permissions ¶
func Permissions(db *sql.DB) (*[]*Permission, error)
Permissions lists all the roles.
func RemoveRelation ¶
RemoveRelation delate an relation
func RemoveURLPermission ¶
RemoveURLPermission -
Types ¶
type RelationData ¶
RelationData -
func AssociatedRoleList ¶
func AssociatedRoleList(db *sql.DB, aid uint32) ([]*RelationData, error)
AssociatedRoleList list all the roles of the specified admin and the return form is slice.
Click to show internal directories.
Click to hide internal directories.