Skip to content

Extracted permission object #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jan 19, 2021
Merged

Extracted permission object #2

merged 40 commits into from
Jan 19, 2021

Conversation

martinheidegger
Copy link
Member

Initial work on extracted permission object. Still parts missing, so: WIP

@martinheidegger martinheidegger marked this pull request as ready for review January 15, 2021 15:29
@martinheidegger
Copy link
Member Author

@RangerMauve This version of my new concept is now pretty much cleaned up and tested. Things that are missing on my list are:

  • Member ordering
  • A better getRequiredSignatures method that takes into consideration the required signatures at that particular point in time.

Copy link
Collaborator

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great so far! Just a few small comments.

}

add <Input extends FeedItem> (item: Input): Input {
const members = this.members.byState.added ?? emptySet as Set<MemberId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get how this could save some memory, but I'm worried it could lead to weird edge cases where the set can get modified. 🤔

private readonly openRequestsByMember = new Map<MemberId, Request[]>()

get isLocked (): boolean {
return this.members.byState.added === undefined && this.members.byState.removed !== undefined
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be renamed to something a bit more verbose, it's not obvious what it does.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was struggling with the naming here, though I thought its a good idea to have it: basically the code allows for all members to be removed, this way the permissions/group would become unwriteable and basically enters an "archived" state. Not sure what to call it...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about isDestroyed? Or is isEmpty or something along those lines. Locked feels like the existing set of members are locked in place, or that you cannot add or remove members for some other reason as a member yourself.

@RangerMauve
Copy link
Collaborator

Gonna merge and add the remaining items as TODOs.

@RangerMauve RangerMauve merged commit 24c7d44 into initial Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants