fix(console): general fixes, project grants for owned and granted context (#425)

* update and delete project grants

* fix: user grant id (#421)

* fix: verboser logging on sql err (#412)

* fix(eventstore): improve insert statement

* fix: verbose logging on error

* fix: simplify insertEvents

* fix: project grant delete (#417)

* fix: add grant id to user grant if needed

* fix: add grant id to user grant if needed

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* fix user grant context

* lint

* role validators

* fix: usergrantid (#424)

* fix: verboser logging on sql err (#412)

* fix(eventstore): improve insert statement

* fix: verbose logging on error

* fix: simplify insertEvents

* fix: project grant delete (#417)

* fix: add grant id to user grant if needed

* fix: add grant id to user grant if needed

* fix: add bulk remove

* fix: merge

Co-authored-by: Silvan <silvan.reusser@gmail.com>

Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
Max Peintner
2020-07-09 15:14:01 +02:00
committed by GitHub
parent cf51bbc36d
commit 0b012f2fa2
39 changed files with 18254 additions and 17184 deletions

View File

@@ -8,6 +8,7 @@ type UserGrant struct {
State UserGrantState
UserID string
ProjectID string
GrantID string
RoleKeys []string
}

View File

@@ -11,6 +11,7 @@ type UserGrantView struct {
ResourceOwner string
UserID string
ProjectID string
GrantID string
UserName string
FirstName string
LastName string

View File

@@ -19,6 +19,7 @@ type UserGrant struct {
State int32 `json:"-"`
UserID string `json:"userId,omitempty"`
ProjectID string `json:"projectId,omitempty"`
GrantID string `json:"grantId,omitempty"`
RoleKeys []string `json:"roleKeys,omitempty"`
}
@@ -40,6 +41,7 @@ func UserGrantFromModel(grant *model.UserGrant) *UserGrant {
ObjectRoot: grant.ObjectRoot,
UserID: grant.UserID,
ProjectID: grant.ProjectID,
GrantID: grant.GrantID,
State: int32(grant.State),
RoleKeys: grant.RoleKeys,
}
@@ -50,6 +52,7 @@ func UserGrantToModel(grant *UserGrant) *model.UserGrant {
ObjectRoot: grant.ObjectRoot,
UserID: grant.UserID,
ProjectID: grant.ProjectID,
GrantID: grant.GrantID,
State: model.UserGrantState(grant.State),
RoleKeys: grant.RoleKeys,
}

View File

@@ -27,6 +27,7 @@ type UserGrantView struct {
ResourceOwner string `json:"-" gorm:"resource_owner"`
UserID string `json:"userId" gorm:"user_id"`
ProjectID string `json:"projectId" gorm:"column:project_id"`
GrantID string `json:"grantId" gorm:"column:grant_id"`
UserName string `json:"-" gorm:"column:user_name"`
FirstName string `json:"-" gorm:"column:first_name"`
LastName string `json:"-" gorm:"column:last_name"`
@@ -49,6 +50,7 @@ func UserGrantFromModel(grant *model.UserGrantView) *UserGrantView {
ResourceOwner: grant.ResourceOwner,
UserID: grant.UserID,
ProjectID: grant.ProjectID,
GrantID: grant.GrantID,
ChangeDate: grant.ChangeDate,
CreationDate: grant.CreationDate,
State: int32(grant.State),