v0.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!


Subscribe to our Newsletter
Get the latest updates about React, Remix, Next.js, Firebase, Supabase and Tailwind CSS

Read more about Changelog

Cover Image for Announcing: Makerkit now supports Lemon Squeezy subscriptions! 馃崑

Announcing: Makerkit now supports Lemon Squeezy subscriptions! 馃崑

2 min read
Announcing support for Lemon Squeezy subscriptions in Makerkit. It's now possible to use a MoR to power your Makerkit app.
Cover Image for Announcing support for Multi-Factor Authentication (MFA) with Supabase

Announcing support for Multi-Factor Authentication (MFA) with Supabase

3 min read
A sneak peek to our coming feature for Multi-Factor Authentication (MFA) with Supabase.
Cover Image for A sneak peek at the Supabase and Next.js RSC SaaS kit

A sneak peek at the Supabase and Next.js RSC SaaS kit

9 min read
A behind the scenes look at how we built the Supabase and Next.js RSC SaaS Starter.
Cover Image for Makerkit 鉂わ笍 Radix UI

Makerkit 鉂わ笍 Radix UI

2 min read
Makerkit migrated its UI Components to Radix UI, bringing a new look and feel to the platform.
Cover Image for Changelog: New Stripe Subscriptions Pages

Changelog: New Stripe Subscriptions Pages

3 min read
We've redesigned the Makerkit subscriptions pages. Let's take a look at the new design.
Cover Image for Planning Makerkit's 2023

Planning Makerkit's 2023

2 min read
A plan for the coming year at Makerkit. New kits, new blog posts, new documentation, courses, and more.