mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-10 16:15:12 +00:00
fix: generated project grant id (#10747)
# Which Problems Are Solved Project Grant ID would have needed to be unique to be handled properly on the projections, but was defined as the organization ID the project was granted to, so could be non-unique. # How the Problems Are Solved Generate the Project Grant ID even in the v2 APIs, which also includes fixes in the integration tests. Additionally to that, the logic for some functionality had to be extended as the Project Grant ID is not provided anymore in the API, so had to be queried before creating events for Project Grants. # Additional Changes Included fix for authorizations, when an authorization was intended to be created for a project, without providing any organization information, which also showed some faulty integration tests. # Additional Context Partially closes #10745 --------- Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Silvan <[email protected]>
This commit is contained in:
co-authored by
Livio Spring
Silvan
parent
adc8fb2013
commit
b6ff4ff16c
@@ -171,7 +171,8 @@ func projectExistsOnOrganization(requiredOrganization, projectResourceOwner stri
|
||||
func projectGrantExistsOnOrganization(requiredGrantID, requiredOrganization, projectGrantID, grantedOrganization string) bool {
|
||||
// Depending on the API, a request can either require a project grant (ID) and/or an organization (ID),
|
||||
// where the project must be granted to.
|
||||
return (requiredGrantID == "" || requiredGrantID == projectGrantID) &&
|
||||
return (requiredGrantID != "" || requiredOrganization != "") &&
|
||||
(requiredGrantID == "" || requiredGrantID == projectGrantID) &&
|
||||
(requiredOrganization == "" || requiredOrganization == grantedOrganization)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user