@@ -36,7 +36,7 @@ func (h *Handler) Config(ctx *gin.Context) {
36
36
37
37
clusters := make ([]Cluster , 0 , len (h .config .Clusters ))
38
38
for _ , cl := range h .config .Clusters {
39
- access := cl .AllowedEmail (profile . Email )
39
+ access := cl .Allowed (profile )
40
40
if access {
41
41
clusters = append (clusters , cl )
42
42
}
@@ -69,7 +69,7 @@ func (h *Handler) ListCustomBoards(ctx *gin.Context) {
69
69
70
70
func (h * Handler ) ListPolicySources (ctx * gin.Context ) {
71
71
if profile := auth .ProfileFrom (ctx ); profile != nil {
72
- if ! h .config .Boards .AllowedEmail (profile . Email ) {
72
+ if ! h .config .Boards .Allowed (profile ) {
73
73
ctx .AbortWithStatus (http .StatusUnauthorized )
74
74
return
75
75
}
@@ -153,7 +153,7 @@ func (h *Handler) GetCustomBoard(ctx *gin.Context) {
153
153
}
154
154
155
155
if profile := auth .ProfileFrom (ctx ); profile != nil {
156
- if ! config .AllowedEmail (profile . Email ) {
156
+ if ! config .Allowed (profile ) {
157
157
ctx .AbortWithStatus (http .StatusUnauthorized )
158
158
return
159
159
}
@@ -252,14 +252,14 @@ func (h *Handler) Layout(ctx *gin.Context) {
252
252
boards = make (map [string ]CustomBoard , len (h .customBoards ))
253
253
254
254
for key , board := range h .customBoards {
255
- if ! board .AllowedEmail (profile . Email ) {
255
+ if ! board .Allowed (profile ) {
256
256
continue
257
257
}
258
258
259
259
boards [key ] = board
260
260
}
261
261
262
- if ! h .config .Boards .AllowedEmail (profile . Email ) {
262
+ if ! h .config .Boards .Allowed (profile ) {
263
263
sources = nil
264
264
}
265
265
} else {
@@ -277,7 +277,7 @@ func (h *Handler) Layout(ctx *gin.Context) {
277
277
278
278
func (h * Handler ) Dashboard (ctx * gin.Context ) {
279
279
if profile := auth .ProfileFrom (ctx ); profile != nil {
280
- if ! h .config .Boards .AllowedEmail (profile . Email ) {
280
+ if ! h .config .Boards .Allowed (profile ) {
281
281
ctx .AbortWithStatus (http .StatusUnauthorized )
282
282
return
283
283
}
@@ -334,7 +334,7 @@ func (h *Handler) Dashboard(ctx *gin.Context) {
334
334
335
335
func (h * Handler ) Policies (ctx * gin.Context ) {
336
336
if profile := auth .ProfileFrom (ctx ); profile != nil {
337
- if ! h .config .Boards .AllowedEmail (profile . Email ) {
337
+ if ! h .config .Boards .Allowed (profile ) {
338
338
ctx .AbortWithStatus (http .StatusUnauthorized )
339
339
return
340
340
}
0 commit comments