-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Should be able to refactor this a bit more.
hr-sample-app/server/src/members/list-all-members/listAllMembersService.ts
Lines 25 to 42 in 23f41ef
| await this.authorizer.authorizedFieldsForUser<Member>( | |
| MEMBER_ACTIONS.READ, | |
| member | |
| ); | |
| const authorizedMember = | |
| member.createObjectWithAuthorizedFields(authorizedFields); | |
| const allowedActions = await this.authorizer.authorizedActionsForUser( | |
| member | |
| ); | |
| if (allowedActions.has(MEMBER_ACTIONS.UPDATE)) { | |
| authorizedMember.editable = true; | |
| } | |
| if (member.id === this.authorizer.currentUser.memberInfo.id) { | |
| authorizedMember.isLoggedInUser = true; | |
| } |