work on determining which secrets accessible to user
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-09 10:59:27 +11:00
parent 7363936cd5
commit 07fd43bf33
5 changed files with 167 additions and 73 deletions

View File

@@ -35,6 +35,7 @@ type UserGroup struct {
Admin bool `db:"Admin"`
}
// Combine Users and Safes to determine which safes a user has access to
type UserSafe struct {
User
SafeId int `db:"SafeId"`
@@ -42,6 +43,13 @@ type UserSafe struct {
GroupId int `db:"GroupId"`
}
// Used for querying all secrets the user has access to
type UserSecret struct {
User
Group
Secret
}
func (u *User) SaveUser() (*User, error) {
var err error