Versions in this module Expand all Collapse all v0 v0.0.4 Jul 7, 2025 Changes in this version + type Database interface + AddPermissionToRole func(ctx context.Context, roleID, permissionID int64) error + AddRole func(ctx context.Context, roleID int64, name string) error + AddRoleToUser func(ctx context.Context, userID, roleID int64) error + AddUser func(ctx context.Context, userID int64, ...) error + CreatePermission func(ctx context.Context, name string) (int64, error) + GetPermissions func(ctx context.Context) ([]Permission, error) + GetRolePermissions func(ctx context.Context, roleID int64) ([]Permission, error) + GetRoles func(ctx context.Context) ([]Role, error) + GetUser func(ctx context.Context, userID int64) (User, error) + GetUserByEmail func(ctx context.Context, email string) (User, error) + GetUserPermissions func(ctx context.Context, userID int64) ([]Permission, error) + GetUserRoles func(ctx context.Context, userID int64) ([]Role, error) + RemoveAllRolesFromUser func(ctx context.Context, userID int64) error + RemovePermissionFromRole func(ctx context.Context, roleID, permissionID int64) error + UpdateRole func(ctx context.Context, roleID int64, name string) error + UpdateUser func(ctx context.Context, userID int64, ...) error + func NewDatabase(dbType ubconst.DatabaseType, db dbsqlite.DBTX) Database + type Permission struct + Name string + PermissionID int64 + type PostgresAdapter struct + func NewPostgresAdapter(db dbpostgres.DBTX) *PostgresAdapter + func (a *PostgresAdapter) AddPermissionToRole(ctx context.Context, roleID, permissionID int64) error + func (a *PostgresAdapter) AddRole(ctx context.Context, roleID int64, name string) error + func (a *PostgresAdapter) AddRoleToUser(ctx context.Context, userID, roleID int64) error + func (a *PostgresAdapter) AddUser(ctx context.Context, userID int64, ...) error + func (a *PostgresAdapter) CreatePermission(ctx context.Context, name string) (int64, error) + func (a *PostgresAdapter) GetPermissions(ctx context.Context) ([]Permission, error) + func (a *PostgresAdapter) GetRolePermissions(ctx context.Context, roleID int64) ([]Permission, error) + func (a *PostgresAdapter) GetRoles(ctx context.Context) ([]Role, error) + func (a *PostgresAdapter) GetUser(ctx context.Context, userID int64) (User, error) + func (a *PostgresAdapter) GetUserByEmail(ctx context.Context, email string) (User, error) + func (a *PostgresAdapter) GetUserPermissions(ctx context.Context, userID int64) ([]Permission, error) + func (a *PostgresAdapter) GetUserRoles(ctx context.Context, userID int64) ([]Role, error) + func (a *PostgresAdapter) RemoveAllRolesFromUser(ctx context.Context, userID int64) error + func (a *PostgresAdapter) RemovePermissionFromRole(ctx context.Context, roleID, permissionID int64) error + func (a *PostgresAdapter) UpdateRole(ctx context.Context, roleID int64, name string) error + func (a *PostgresAdapter) UpdateUser(ctx context.Context, userID int64, ...) error + type Role struct + Name string + RoleID int64 + type SQLiteAdapter struct + func NewSQLiteAdapter(db dbsqlite.DBTX) *SQLiteAdapter + func (a *SQLiteAdapter) AddPermissionToRole(ctx context.Context, roleID, permissionID int64) error + func (a *SQLiteAdapter) AddRole(ctx context.Context, roleID int64, name string) error + func (a *SQLiteAdapter) AddRoleToUser(ctx context.Context, userID, roleID int64) error + func (a *SQLiteAdapter) AddUser(ctx context.Context, userID int64, ...) error + func (a *SQLiteAdapter) CreatePermission(ctx context.Context, name string) (int64, error) + func (a *SQLiteAdapter) GetPermissions(ctx context.Context) ([]Permission, error) + func (a *SQLiteAdapter) GetRolePermissions(ctx context.Context, roleID int64) ([]Permission, error) + func (a *SQLiteAdapter) GetRoles(ctx context.Context) ([]Role, error) + func (a *SQLiteAdapter) GetUser(ctx context.Context, userID int64) (User, error) + func (a *SQLiteAdapter) GetUserByEmail(ctx context.Context, email string) (User, error) + func (a *SQLiteAdapter) GetUserPermissions(ctx context.Context, userID int64) ([]Permission, error) + func (a *SQLiteAdapter) GetUserRoles(ctx context.Context, userID int64) ([]Role, error) + func (a *SQLiteAdapter) RemoveAllRolesFromUser(ctx context.Context, userID int64) error + func (a *SQLiteAdapter) RemovePermissionFromRole(ctx context.Context, roleID, permissionID int64) error + func (a *SQLiteAdapter) UpdateRole(ctx context.Context, roleID int64, name string) error + func (a *SQLiteAdapter) UpdateUser(ctx context.Context, userID int64, ...) error + type User struct + DisplayName string + Email string + FirstName string + LastName string + UserID int64 v0.0.2 Jun 24, 2025