File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
packages/adapter-azure/src Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @storybooker/adapter-azure " : patch
3+ " @storybooker/core " : patch
4+ ---
5+
6+ Update UI + Add app type in EasyAuth
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export type { AuthServiceAuthorise } from "@storybooker/core";
1212
1313export interface EasyAuthUser extends StoryBookerUser {
1414 roles : string [ ] | null ;
15+ type : "application" | "user" ;
1516}
1617
1718export type EasyAuthRoleMap = Map < string , Permission [ ] > ;
@@ -24,6 +25,10 @@ const DEFAULT_AUTHORISE: AuthServiceAuthorise<EasyAuthUser> = (
2425 return false ;
2526 }
2627
28+ if ( user . type === "application" ) {
29+ return true ;
30+ }
31+
2732 if ( action === "read" ) {
2833 return true ;
2934 }
@@ -64,7 +69,12 @@ export class AzureEasyAuthService implements AuthService<EasyAuthUser> {
6469
6570 const azpToken = claims . find ( ( claim ) => claim . typ === "azp" ) ?. val ;
6671 if ( azpToken ) {
67- return { displayName : "Application" , id : azpToken , roles : null } ;
72+ return {
73+ displayName : "App" ,
74+ id : azpToken ,
75+ roles : null ,
76+ type : "application" ,
77+ } ;
6878 }
6979
7080 const name = claims . find ( ( claim ) => claim . typ === "name" ) ?. val ;
@@ -83,6 +93,7 @@ export class AzureEasyAuthService implements AuthService<EasyAuthUser> {
8393 id : email || "" ,
8494 roles,
8595 title : roles . join ( ", " ) ,
96+ type : "user" ,
8697 } ;
8798 }
8899
You can’t perform that action at this time.
0 commit comments