mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
fix: move activity log to queries and remove old code (#3096)
* move changes to queries and remove old code * fix changes query * remove unused code * fix sorting * fix sorting * refactor and remove old code * remove accidental go.mod replace * add missing file * remove listDetail from ChangesResponse
This commit is contained in:
23
internal/domain/permission.go
Normal file
23
internal/domain/permission.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package domain
|
||||
|
||||
type Permissions struct {
|
||||
Permissions []string
|
||||
}
|
||||
|
||||
func (p *Permissions) AppendPermissions(ctxID string, permissions ...string) {
|
||||
for _, permission := range permissions {
|
||||
p.appendPermission(ctxID, permission)
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Permissions) appendPermission(ctxID, permission string) {
|
||||
if ctxID != "" {
|
||||
permission = permission + ":" + ctxID
|
||||
}
|
||||
for _, existingPermission := range p.Permissions {
|
||||
if existingPermission == permission {
|
||||
return
|
||||
}
|
||||
}
|
||||
p.Permissions = append(p.Permissions, permission)
|
||||
}
|
Reference in New Issue
Block a user