Documentation ¶
Index ¶
- type AclRole
- type Module
- type User
- func (user *User) Can(permission string) bool
- func (user *User) CanDeleteComment(ownerID, categoryID bson.ObjectId) bool
- func (user *User) CanDeletePost(post *feed.Post) bool
- func (user *User) CanLockPost(post *feed.Post) bool
- func (user *User) CanRead(category model.Category) bool
- func (user *User) CanSolvePost(post *feed.Post) bool
- func (user *User) CanUpdateComment(ownerID, categoryID bson.ObjectId) bool
- func (user *User) CanUpdatePost(post *feed.Post) bool
- func (user *User) CanWrite(writable []string) bool
- func (user *User) HasValidated() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { Map *gorbac.RBAC Rules map[string]AclRole Permissions map[string]gorbac.Permission }
var LoadedACL *Module
func (*Module) CheckPermissions ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) CanDeleteComment ¶
Check if user can delete comment
func (*User) CanDeletePost ¶
Check if user can delete post
func (*User) CanLockPost ¶
Check if user can lock post
func (*User) CanSolvePost ¶
Check if user can solve post
func (*User) CanUpdateComment ¶
CanUpdateComment helper.
func (*User) CanUpdatePost ¶
Check if user can update post
func (*User) HasValidated ¶
Click to show internal directories.
Click to hide internal directories.