Skip to content

Commit

Permalink
OSCI-6562
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Stepanov <[email protected]>
  • Loading branch information
Andrei-Stepanov committed Mar 25, 2024
1 parent 6515cd0 commit 8b48588
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/schema/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,7 @@ export const metadataUpdate: GraphQLFieldConfig<any, any> = {
* Local devel: set `user` to:
* fakeUser = { nameID: 'an', displayName: 'A N', Role: ['Employee'] } as UserSamlType,
*/
const fakeUser = {
nameID: 'an',
displayName: 'A N',
Role: ['Employee'],
} as UserSamlType;
const rwGroups = _.intersection(fakeUser.Role, allowedRWGroups);
const rwGroups = _.intersection(user.Role, allowedRWGroups);
if (_.isEmpty(rwGroups)) {
const comment = util.format(
'User does not stay in any allowed RW group to update metadata: %s, %s.',
Expand All @@ -213,7 +208,7 @@ export const metadataUpdate: GraphQLFieldConfig<any, any> = {
}
log(
'User %s is granted to perform RW action. User is part of %s groups.',
fakeUser.displayName,
user.displayName,
rwGroups,
);
let opensearchClient: OpensearchClient;
Expand Down

0 comments on commit 8b48588

Please sign in to comment.