mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 23:47:33 +00:00
fix(usergrant): verify project id is equal (#319)
* fix(usergrant): verify project id is equal * fix: delete wrong code
This commit is contained in:
@@ -214,7 +214,11 @@ func addUserGrantValidation(resourceOwner string, grant *model.UserGrant) func(.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: rethink this function i know it's ugly.
|
||||||
func checkProjectConditions(resourceOwner string, grant *model.UserGrant, project *proj_es_model.Project) error {
|
func checkProjectConditions(resourceOwner string, grant *model.UserGrant, project *proj_es_model.Project) error {
|
||||||
|
if grant.ProjectID != project.AggregateID {
|
||||||
|
return errors.ThrowInvalidArgument(nil, "EVENT-ixlMx", "project doesn't exist")
|
||||||
|
}
|
||||||
if project.State == int32(proj_model.ProjectStateRemoved) {
|
if project.State == int32(proj_model.ProjectStateRemoved) {
|
||||||
return errors.ThrowPreconditionFailed(nil, "EVENT-Lxp0s", "project doesn't exist")
|
return errors.ThrowPreconditionFailed(nil, "EVENT-Lxp0s", "project doesn't exist")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user