Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminUser = NewUser("ADMIN_USER", nil, true, nil)
This user has all privileges for all resources.
View Source
var PrivilegeList []Privilege
Functions ¶
func APIResource ¶
func DatabaseResource ¶
Types ¶
type Interface ¶
type Interface interface { Authenticate(username, password string) (User, error) User(username string) (User, error) SubscriptionUser(token string) (User, error) GrantSubscriptionAccess(token, db, rp string) error ListSubscriptionTokens() ([]string, error) RevokeSubscriptionAccess(token string) error }
Interface for authenticating and retrieving users.
type User ¶
type User struct {
// contains filtered or unexported fields
}
This structure is designed to be immutable, to avoid bugs/exploits where the user could be modified by external code. For this reason all fields are private and methods are value receivers.
func (User) AuthorizeAction ¶
Determine wether the user is authorized to take the action. Returns nil if the action is authorized, otherwise returns an error describing the needed permissions.
func (User) Privileges ¶
Return a copy of the privileges the user has.
Click to show internal directories.
Click to hide internal directories.