Skip to content

sdk/lib/users

function combineRanks(rank: string, users: SingleRank[]): CombinedRank[]

Defined in: studiocms/packages/studiocms/src/sdk/lib/users.ts:51

Combines a given rank with an array of user ranks.

string

The rank to be combined with each user.

SingleRank[]

An array of user ranks to be combined with the given rank.

CombinedRank[]

An array of combined ranks, where each element includes the given rank and the properties of a user rank.


function verifyRank(
users: {
avatar: null | string;
createdAt: null | Date;
email: null | string;
id: string;
name: string;
password: null | string;
updatedAt: null | Date;
url: null | string;
username: string;
}[],
permissions: {
rank: string;
user: string;
}[],
rank: string): SingleRank[]

Defined in: studiocms/packages/studiocms/src/sdk/lib/users.ts:18

Verifies the rank of users based on the provided permissions and rank.

{ avatar: null | string; createdAt: null | Date; email: null | string; id: string; name: string; password: null | string; updatedAt: null | Date; url: null | string; username: string; }[]

An array of user objects to be verified.

{ rank: string; user: string; }[]

An array of permission objects that include user ranks.

string

The rank to be verified against the permissions.

SingleRank[]

An array of objects containing the id and name of users with the specified rank.

If an error occurs during the verification process.