mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
feat: check has project (#2206)
* feat: define org grant check on project * feat: has project check * feat: has project check * feat: check has project * feat: check has project * feat: add has project check to console * Update internal/auth/repository/eventsourcing/eventstore/auth_request.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/auth/repository/eventsourcing/eventstore/auth_request.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/auth/repository/eventsourcing/eventstore/auth_request.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/auth/repository/eventsourcing/eventstore/auth_request.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/auth/repository/eventsourcing/eventstore/auth_request_test.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/auth/repository/eventsourcing/eventstore/auth_request_test.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/auth/repository/eventsourcing/eventstore/auth_request_test.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/ui/login/static/i18n/en.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: add has project tests Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
53
internal/project/model/org_project_mapping_view.go
Normal file
53
internal/project/model/org_project_mapping_view.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
|
||||
"time"
|
||||
)
|
||||
|
||||
type OrgProjectMapping struct {
|
||||
OrgID string
|
||||
ProjectID string
|
||||
}
|
||||
|
||||
type OrgProjectMappingViewSearchRequest struct {
|
||||
Offset uint64
|
||||
Limit uint64
|
||||
SortingColumn OrgProjectMappingViewSearchKey
|
||||
Asc bool
|
||||
Queries []*OrgProjectMappingViewSearchQuery
|
||||
}
|
||||
|
||||
type OrgProjectMappingViewSearchKey int32
|
||||
|
||||
const (
|
||||
OrgProjectMappingSearchKeyUnspecified OrgProjectMappingViewSearchKey = iota
|
||||
OrgProjectMappingSearchKeyProjectID
|
||||
OrgProjectMappingSearchKeyOrgID
|
||||
OrgProjectMappingSearchKeyProjectGrantID
|
||||
)
|
||||
|
||||
type OrgProjectMappingViewSearchQuery struct {
|
||||
Key OrgProjectMappingViewSearchKey
|
||||
Method domain.SearchMethod
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
type OrgProjectMappingViewSearchResponse struct {
|
||||
Offset uint64
|
||||
Limit uint64
|
||||
TotalResult uint64
|
||||
Result []*OrgProjectMapping
|
||||
Sequence uint64
|
||||
Timestamp time.Time
|
||||
}
|
||||
|
||||
func (r *OrgProjectMappingViewSearchRequest) GetSearchQuery(key OrgProjectMappingViewSearchKey) (int, *OrgProjectMappingViewSearchQuery) {
|
||||
for i, q := range r.Queries {
|
||||
if q.Key == key {
|
||||
return i, q
|
||||
}
|
||||
}
|
||||
return -1, nil
|
||||
}
|
@@ -17,6 +17,7 @@ type Project struct {
|
||||
Grants []*ProjectGrant
|
||||
ProjectRoleAssertion bool
|
||||
ProjectRoleCheck bool
|
||||
HasProjectCheck bool
|
||||
}
|
||||
type ProjectChanges struct {
|
||||
Changes []*ProjectChange
|
||||
|
@@ -16,6 +16,7 @@ type ProjectView struct {
|
||||
ResourceOwner string
|
||||
ProjectRoleAssertion bool
|
||||
ProjectRoleCheck bool
|
||||
HasProjectCheck bool
|
||||
Sequence uint64
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user