Changelogv0.2.0: Transferring Ownership of an organization

The version 0.2.0 adds the ability to transfer the ownership of an organization to another member

·2 min read
Cover Image for v0.2.0: Transferring Ownership of an organization

The newly released version 0.2.0 adds the ability for the owners of an organization to transfer ownership to another member of the organization.

Check out the video below for a quick demo:

Loading video...

When the owner of an organization transfers the ownership to another member, the owner's account will automatically be turned into an Admin account.

You will need to update the code if you have added custom roles, eg. if you replaced the "Admin" role with another one.

Furthermore, I strengthened some checks around the ability to remove members from an organization and update a member's role:

function assertUserCanUpdateMember(params: {
  organization: Organization;
  currentUserId: string;
  targetUserId: string;
}) {
  const members = params.organization.members;
  const currentUser = members[params.currentUserId];
  const targetUser = members[params.targetUserId];

  if (!targetUser) {
    return throwNotFoundException(`Target member was not found`);
  }

  if (!currentUser) {
    return throwNotFoundException(`Current member was not found`);
  }

  if (currentUser.role <= targetUser.role) {
    return throwUnauthorizedException(
      `Current member does not have a greater role than target member`
    );
  }
}

The function above can be reused when a user is performing an action that affects another user.

Generally, we use user roles hierarchically, which means if a role is equal to or smaller than another, then it cannot perform an action that affects this user's permissions.

To update your repository, run the following command:

git pull upstream main

If you encounter too many conflicts while updating, please feel free to reach out!


Stay informed with our latest resources for building a SaaS

Subscribe to our newsletter to receive updatesor

Read more about
Changelog

Cover Image for v0.5.0: Design Improvements and code-cleanup

v0.5.0: Design Improvements and code-cleanup

·2 min read
The version 0.5.0 adds improvements to the overall design, and adds Firebase Storage security rules backed by Firestore
Cover Image for v0.4.0: Phone Authentication

v0.4.0: Phone Authentication

·2 min read
The version 0.4.0 adds the ability to sign-in using a Phone number, and adds design and usability improvements to the authentication pages
Cover Image for v0.3.0: Multi-Factor Authentication and Multi-Provider accounts

v0.3.0: Multi-Factor Authentication and Multi-Provider accounts

·2 min read
The version 0.3.0 adds the ability to enable Multi-Factor Authentication and for users to link their account to multiple providers
Cover Image for Makerkit upgraded to React 18

Makerkit upgraded to React 18

·2 min read
React 18 has been released, and with it many exciting features.
Cover Image for Get paid with Stripe

Get paid with Stripe

·2 min read
MakerKit makes it super-easy to add Stripe payment and subscriptions to your Firebase and Next.js application. Learn how!