mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-18 00:42:29 +00:00
feat: delete (#243)
* feat: project role remove * feat: search queries * feat: search queries * feat: cascade remove/change project role * fix: comment in project grant * fix: remove projecr grant * fix: only search usergrants of my org * fix: delete usergrants * fix: delete usergrants * fix: check if role exists on project grant * feat: bulk add project role * fix: tests * fix: update user grants on project update * fix: return roles * feat: add resourceowner name on project grants * fix: migration number * fix: tests * fix: generate protos * fix: some unnecessary code
This commit is contained in:
@@ -23,6 +23,10 @@ func (v *View) ProjectGrantsByProjectID(projectID string) ([]*model.ProjectGrant
|
||||
return view.ProjectGrantsByProjectID(v.Db, grantedProjectTable, projectID)
|
||||
}
|
||||
|
||||
func (v *View) ProjectGrantsByProjectIDAndRoleKey(projectID, key string) ([]*model.ProjectGrantView, error) {
|
||||
return view.ProjectGrantsByProjectIDAndRoleKey(v.Db, grantedProjectTable, projectID, key)
|
||||
}
|
||||
|
||||
func (v *View) SearchProjectGrants(request *proj_model.ProjectGrantViewSearchRequest) ([]*model.ProjectGrantView, int, error) {
|
||||
return view.SearchProjectGrants(v.Db, grantedProjectTable, request)
|
||||
}
|
||||
@@ -38,7 +42,7 @@ func (v *View) PutProjectGrant(project *model.ProjectGrantView) error {
|
||||
func (v *View) DeleteProjectGrant(grantID string, eventSequence uint64) error {
|
||||
err := view.DeleteProjectGrant(v.Db, grantedProjectTable, grantID)
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
return v.ProcessedProjectGrantSequence(eventSequence)
|
||||
}
|
||||
|
@@ -31,6 +31,14 @@ func (v *View) UserGrantsByOrgID(orgID string) ([]*model.UserGrantView, error) {
|
||||
return view.UserGrantsByOrgID(v.Db, userGrantTable, orgID)
|
||||
}
|
||||
|
||||
func (v *View) UserGrantsByProjectIDAndRoleKey(projectID, roleKey string) ([]*model.UserGrantView, error) {
|
||||
return view.UserGrantsByProjectIDAndRole(v.Db, userGrantTable, projectID, roleKey)
|
||||
}
|
||||
|
||||
func (v *View) UserGrantsByOrgIDAndProjectID(orgID, projectID string) ([]*model.UserGrantView, error) {
|
||||
return view.UserGrantsByOrgIDAndProjectID(v.Db, userGrantTable, orgID, projectID)
|
||||
}
|
||||
|
||||
func (v *View) PutUserGrant(grant *model.UserGrantView, sequence uint64) error {
|
||||
err := view.PutUserGrant(v.Db, userGrantTable, grant)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user