Skip to content

Commit 187a6d1

Browse files
authored
Account-admins (#455)
* added activeAccount.admins to currentUser * bumped version to `0.57.0`
1 parent 349f26e commit 187a6d1

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.56.0
1+
0.57.0

pkg/codefresh/model/unmarshal.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,13 @@ func (a *Application) UnmarshalJSON(data []byte) error {
9797

9898
return nil
9999
}
100+
101+
func (u *User) IsActiveAccountAdmin() bool {
102+
for _, id := range u.ActiveAccount.Admins {
103+
if id == u.ID {
104+
return true
105+
}
106+
}
107+
108+
return false
109+
}

pkg/codefresh/users_v2.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (u *usersV2) GetCurrent(ctx context.Context) (*model.User, error) {
4646
gitProvider
4747
gitApiUrl
4848
sharedConfigRepo
49+
admins
4950
}
5051
}
5152
}

0 commit comments

Comments
 (0)