Skip to content

the creation of DisplayableMember is quite dirty #12

@kenfdev

Description

@kenfdev

Should be able to refactor this a bit more.

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;
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions