@@ -11,6 +11,7 @@ import { selectUserSettingsPageViewModel } from "state-management/selectors/user
1111import { fetchCurrentUserAction } from "state-management/actions/user.actions" ;
1212import { MatAutocompleteSelectedEvent } from "@angular/material/autocomplete" ;
1313import { Subscription } from "rxjs" ;
14+ import { selectGroupFilter } from "state-management/selectors/datasets.selectors" ;
1415
1516@Component ( {
1617 selector : "owner-group-renderer" ,
@@ -98,25 +99,22 @@ export class OwnerGroupFieldComponent
9899 // Fetch the owner groups from the scicat user
99100 this . componentSubscriptions . push (
100101 this . vm$ . subscribe ( ( settings ) => {
101- const getclaims = ( profile : any ) : string [ ] | null => {
102+ const getPossibleOwnerGroups = ( profile : any ) : string [ ] | null => {
102103 if ( ! profile ) {
103104 return null ;
104105 }
106+ var accessGroups = profile . accessGroups ?? null ;
105107
106- if ( profile . oidcClaims !== undefined ) {
107- return settings . profile . oidcClaims . accessGroups ?? null ;
108+ if ( accessGroups === null && profile . oidcClaims !== undefined ) {
109+ accessGroups = profile . oidcClaims . accessGroups ?? null ;
108110 }
109111
110- if ( profile . accessGroups !== undefined ) {
111- return settings . profile . accessGroups ?? null ;
112- }
113-
114- return null ;
112+ return accessGroups ;
115113 } ;
116114
117- const claims = getclaims ( settings . profile ) ;
118- if ( claims !== null && claims . length > 0 ) {
119- this . userOwnerGroups = claims ;
115+ const ownerGroups = getPossibleOwnerGroups ( settings . profile ) ;
116+ if ( ownerGroups !== null && ownerGroups . length > 0 ) {
117+ this . userOwnerGroups = ownerGroups ;
120118 } else {
121119 this . userOwnerGroups = [ ] ;
122120
0 commit comments