Skip to content
Snippets Groups Projects
user.go 626 B
Newer Older
  • Learn to ignore specific revisions
  • package rbac
    
    import (
    	"github.com/google/uuid"
    )
    
    // Users represents a set of multiple users.
    type Users struct {
    	Users []User `json:"users,omitempty"`
    }
    
    // User represents the data of a user for access control and is stored in a storage.
    type User struct {
    	ID       uuid.UUID `json:"id,omitempty"`
    	Name     string    `json:"name,omitempty"`
    	Roles    []string  `json:"roles,omitempty"`
    	PndID    uuid.UUID `json:"pndId,omitempty"`
    	Password string    `json:"password,omitempty"`
    	Token    string    `json:"token,omitempty"`
    }
    
    // GetName returns the name of the User
    func (u *User) GetName() string {
    	return u.Name
    }