zitadel/internal/project/model/project_role_view.go
Fabi 7a6ca24625
feat: multiple domains (#188)
* check uniqueness on create and register user

* change user email, reserve release unique email

* usergrant unique aggregate

* usergrant uniqueness

* validate UserGrant

* fix tests

* domain is set on username in all orgs

* domain in admin

* org domain sql

* zitadel domain org name

* org domains

* org iam policy

* default org iam policy

* SETUP

* load login names

* login by login name

* login name

* fix: merge master

* fix: merge master

* Update internal/user/repository/eventsourcing/user.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* fix: fix unique domains

* fix: rename env variable

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2020-06-16 11:40:18 +02:00

63 lines
1.5 KiB
Go

package model
import (
"github.com/caos/zitadel/internal/model"
"time"
)
type ProjectRoleView struct {
ResourceOwner string
OrgID string
ProjectID string
Key string
DisplayName string
Group string
CreationDate time.Time
Sequence uint64
}
type ProjectRoleSearchRequest struct {
Offset uint64
Limit uint64
SortingColumn ProjectRoleSearchKey
Asc bool
Queries []*ProjectRoleSearchQuery
}
type ProjectRoleSearchKey int32
const (
PROJECTROLESEARCHKEY_UNSPECIFIED ProjectRoleSearchKey = iota
PROJECTROLESEARCHKEY_KEY
PROJECTROLESEARCHKEY_PROJECTID
PROJECTROLESEARCHKEY_ORGID
PROJECTROLESEARCHKEY_RESOURCEOWNER
PROJECTROLESEARCHKEY_DISPLAY_NAME
)
type ProjectRoleSearchQuery struct {
Key ProjectRoleSearchKey
Method model.SearchMethod
Value interface{}
}
type ProjectRoleSearchResponse struct {
Offset uint64
Limit uint64
TotalResult uint64
Result []*ProjectRoleView
}
func (r *ProjectRoleSearchRequest) AppendMyOrgQuery(orgID string) {
r.Queries = append(r.Queries, &ProjectRoleSearchQuery{Key: PROJECTROLESEARCHKEY_ORGID, Method: model.SEARCHMETHOD_EQUALS, Value: orgID})
}
func (r *ProjectRoleSearchRequest) AppendProjectQuery(projectID string) {
r.Queries = append(r.Queries, &ProjectRoleSearchQuery{Key: PROJECTROLESEARCHKEY_PROJECTID, Method: model.SEARCHMETHOD_EQUALS, Value: projectID})
}
func (r *ProjectRoleSearchRequest) EnsureLimit(limit uint64) {
if r.Limit == 0 || r.Limit > limit {
r.Limit = limit
}
}