you are not allowed to list users 403 error

i want to create superadmin for the owner of sas project,

auth
    additionalFields: {
      role: {
        type: ["user", "admin", "superadmin"],
      },
    },
  },
  plugins: [
    username(),
    admin({
      ac,
      roles: {
        admin: adminRole,
        superadmin,
      },
    }),


and for authClient.tsx
 adminClient({
      ac,
      roles: {
        admin: adminRole,
        superadmin,
      },
    }),


and its still showing
"code": "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS",


here is my permissions:
const statement = {
  ...defaultStatements,
} as const;

export const ac = createAccessControl(statement);

const adminRole = ac.newRole({
  ...adminAc.statements,
});

const superadmin = ac.newRole({
  ...adminAc.statements,
});

export { adminRole, superadmin };
Was this page helpful?