Documentation
¶
Index ¶
- type CreatePermissionParams
- type CreateRoleParams
- type CreateRolePermissionParams
- type CreateRoleUserParams
- type DBTX
- type IsAuthorizedParams
- type Permission
- type Queries
- func (q *Queries) CreatePermission(ctx context.Context, arg CreatePermissionParams) (int64, error)
- func (q *Queries) CreateRole(ctx context.Context, arg CreateRoleParams) (int64, error)
- func (q *Queries) CreateRolePermission(ctx context.Context, arg CreateRolePermissionParams) (int64, error)
- func (q *Queries) CreateRoleUser(ctx context.Context, arg CreateRoleUserParams) (int64, error)
- func (q *Queries) FindAllPermissions(ctx context.Context) ([]Permission, error)
- func (q *Queries) IsAuthorized(ctx context.Context, arg IsAuthorizedParams) (uuid.UUID, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Role
- type RolePermission
- type RoleUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePermissionParams ¶
type CreatePermissionParams struct {
PermissionID uuid.UUID
PermissionExtlID string
Resource string
Operation string
PermissionDescription string
Active sql.NullBool
CreateAppID uuid.UUID
CreateUserID uuid.NullUUID
CreateTimestamp time.Time
UpdateAppID uuid.UUID
UpdateUserID uuid.NullUUID
UpdateTimestamp time.Time
}
type CreateRoleParams ¶
type CreateRoleUserParams ¶
type IsAuthorizedParams ¶
type Permission ¶
type Permission struct {
// The unique ID for the table.
PermissionID uuid.UUID
// Unique External ID to be given to outside callers.
PermissionExtlID string
// A human-readable string which represents a resource (e.g. an HTTP route or document, etc.).
Resource string
// A string representing the action taken on the resource (e.g. POST, GET, edit, etc.)
Operation string
// A description of what the permission is granting, e.g. "grants ability to edit a billing document".
PermissionDescription string
// A boolean denoting whether the permission is active (true) or not (false).
Active sql.NullBool
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The permission table stores an approval of a mode of access to a resource.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreatePermission ¶
func (*Queries) CreateRole ¶
func (*Queries) CreateRolePermission ¶
func (*Queries) CreateRoleUser ¶
func (*Queries) FindAllPermissions ¶
func (q *Queries) FindAllPermissions(ctx context.Context) ([]Permission, error)
func (*Queries) IsAuthorized ¶
type Role ¶
type Role struct {
// The unique ID for the table.
RoleID uuid.UUID
// Unique External ID to be given to outside callers.
RoleExtlID string
// A human-readable code which represents the role.
RoleCd string
// A longer description of the role.
RoleDescription string
// A boolean denoting whether the role is active (true) or not (false).
Active sql.NullBool
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The role table stores a job function or title which defines an authority level.
type RolePermission ¶
type RolePermission struct {
// The unique role which can have 1 to many permissions set in this table.
RoleID uuid.UUID
// The unique permission that is being given to the role.
PermissionID uuid.UUID
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The role_permission table stores which roles have which permissions.
type RoleUser ¶
type RoleUser struct {
// The unique role which can have one to many users set in this table.
RoleID uuid.UUID
// The unique user that is being given the role.
UserID uuid.UUID
// The application which created this record.
CreateAppID uuid.UUID
// The user which created this record.
CreateUserID uuid.NullUUID
// The timestamp when this record was created.
CreateTimestamp time.Time
// The application which performed the most recent update to this record.
UpdateAppID uuid.UUID
// The user which performed the most recent update to this record.
UpdateUserID uuid.NullUUID
// The timestamp when the record was updated most recently.
UpdateTimestamp time.Time
}
The role_user table stores which roles have which users.
Click to show internal directories.
Click to hide internal directories.