Documentation
¶
Index ¶
- type AccessControlPluginConfig
- type AddRolePermissionRequest
- type AddRolePermissionResponse
- type AssignUserRoleRequest
- type AssignUserRoleResponse
- type CreatePermissionRequest
- type CreatePermissionResponse
- type CreateRoleRequest
- type CreateRoleResponse
- type DeletePermissionResponse
- type DeleteRoleResponse
- type GetUserEffectivePermissionsResponse
- type Permission
- type PermissionGrantSource
- type RemoveRolePermissionResponse
- type RemoveUserRoleResponse
- type ReplaceRolePermissionResponse
- type ReplaceRolePermissionsRequest
- type ReplaceUserRolesRequest
- type ReplaceUserRolesResponse
- type Role
- type RoleDetails
- type RolePermission
- type UpdatePermissionRequest
- type UpdatePermissionResponse
- type UpdateRoleRequest
- type UpdateRoleResponse
- type UserAuthorizationProfile
- type UserPermissionInfo
- type UserRole
- type UserRoleInfo
- type UserWithPermissions
- type UserWithRoles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControlPluginConfig ¶
type AccessControlPluginConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
}
func (*AccessControlPluginConfig) ApplyDefaults ¶
func (config *AccessControlPluginConfig) ApplyDefaults()
type AddRolePermissionRequest ¶
type AddRolePermissionRequest struct {
PermissionID string `json:"permission_id"`
}
type AddRolePermissionResponse ¶
type AddRolePermissionResponse struct {
Message string `json:"message"`
}
type AssignUserRoleRequest ¶
type AssignUserRoleResponse ¶
type AssignUserRoleResponse struct {
Message string `json:"message"`
}
type CreatePermissionRequest ¶
type CreatePermissionResponse ¶
type CreatePermissionResponse struct {
Permission *Permission `json:"permission"`
}
type CreateRoleRequest ¶
type CreateRoleResponse ¶
type CreateRoleResponse struct {
Role *Role `json:"role"`
}
type DeletePermissionResponse ¶
type DeletePermissionResponse struct {
Message string `json:"message"`
}
type DeleteRoleResponse ¶
type DeleteRoleResponse struct {
Message string `json:"message"`
}
type GetUserEffectivePermissionsResponse ¶
type GetUserEffectivePermissionsResponse struct {
Permissions []UserPermissionInfo `json:"permissions"`
}
type Permission ¶
type Permission struct {
bun.BaseModel `bun:"table:access_control_permissions"`
ID string `json:"id" bun:"column:id,pk"`
Key string `json:"key" bun:"column:key"`
Description *string `json:"description" bun:"column:description"`
IsSystem bool `json:"is_system" bun:"column:is_system"`
CreatedAt time.Time `json:"created_at" bun:"column:created_at,default:current_timestamp"`
UpdatedAt time.Time `json:"updated_at" bun:"column:updated_at,default:current_timestamp"`
}
type PermissionGrantSource ¶
type RemoveRolePermissionResponse ¶
type RemoveRolePermissionResponse struct {
Message string `json:"message"`
}
type RemoveUserRoleResponse ¶
type RemoveUserRoleResponse struct {
Message string `json:"message"`
}
type ReplaceRolePermissionResponse ¶
type ReplaceRolePermissionResponse struct {
Message string `json:"message"`
}
type ReplaceRolePermissionsRequest ¶
type ReplaceRolePermissionsRequest struct {
PermissionIDs []string `json:"permission_ids"`
}
type ReplaceUserRolesRequest ¶
type ReplaceUserRolesRequest struct {
RoleIDs []string `json:"role_ids"`
}
type ReplaceUserRolesResponse ¶
type ReplaceUserRolesResponse struct {
Message string `json:"message"`
}
type Role ¶
type Role struct {
bun.BaseModel `bun:"table:access_control_roles"`
ID string `json:"id" bun:"column:id,pk"`
Name string `json:"name" bun:"column:name"`
Description *string `json:"description" bun:"column:description"`
IsSystem bool `json:"is_system" bun:"column:is_system"`
CreatedAt time.Time `json:"created_at" bun:"column:created_at,default:current_timestamp"`
UpdatedAt time.Time `json:"updated_at" bun:"column:updated_at,default:current_timestamp"`
}
type RoleDetails ¶
type RoleDetails struct {
Role Role `json:"role"`
Permissions []UserPermissionInfo `json:"permissions"`
}
type RolePermission ¶
type RolePermission struct {
bun.BaseModel `bun:"table:access_control_role_permissions"`
RoleID string `json:"role_id" bun:"column:role_id,pk"`
PermissionID string `json:"permission_id" bun:"column:permission_id,pk"`
GrantedByUserID *string `json:"granted_by_user_id" bun:"column:granted_by_user_id"`
GrantedAt time.Time `json:"granted_at" bun:"column:granted_at"`
}
type UpdatePermissionRequest ¶
type UpdatePermissionRequest struct {
Description *string `json:"description,omitempty"`
}
type UpdatePermissionResponse ¶
type UpdatePermissionResponse struct {
Permission *Permission `json:"permission"`
}
type UpdateRoleRequest ¶
type UpdateRoleResponse ¶
type UpdateRoleResponse struct {
Role *Role `json:"role"`
}
type UserAuthorizationProfile ¶
type UserAuthorizationProfile struct {
User models.User `json:"user"`
Roles []UserRoleInfo `json:"roles"`
Permissions []UserPermissionInfo `json:"permissions"`
}
type UserPermissionInfo ¶
type UserPermissionInfo struct {
PermissionID string `json:"permission_id"`
PermissionKey string `json:"permission_key"`
PermissionDescription *string `json:"permission_description,omitempty"`
GrantedByUserID *string `json:"granted_by_user_id,omitempty"`
GrantedAt *time.Time `json:"granted_at,omitempty"`
Sources []PermissionGrantSource `json:"sources,omitempty"`
}
type UserRole ¶
type UserRole struct {
bun.BaseModel `bun:"table:access_control_user_roles"`
UserID string `json:"user_id" bun:"column:user_id,pk"`
RoleID string `json:"role_id" bun:"column:role_id,pk"`
AssignedByUserID *string `json:"assigned_by_user_id" bun:"column:assigned_by_user_id"`
AssignedAt time.Time `json:"assigned_at" bun:"column:assigned_at"`
ExpiresAt *time.Time `json:"expires_at" bun:"column:expires_at"`
}
type UserRoleInfo ¶
type UserRoleInfo struct {
RoleID string `json:"role_id"`
RoleName string `json:"role_name"`
RoleDescription *string `json:"role_description,omitempty"`
AssignedByUserID *string `json:"assigned_by_user_id,omitempty"`
AssignedAt *time.Time `json:"assigned_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
type UserWithPermissions ¶
type UserWithPermissions struct {
User models.User `json:"user"`
Permissions []UserPermissionInfo `json:"permissions"`
}
type UserWithRoles ¶
type UserWithRoles struct {
User models.User `json:"user"`
Roles []UserRoleInfo `json:"roles"`
}
Click to show internal directories.
Click to hide internal directories.