sdk/lib/users
Functions
'Read the “', Functions, '” section'combineRanks()
'Read the “', combineRanks(), '” section'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.
Parameters
'Read the “', Parameters, '” section'string
The rank to be combined with each user.
An array of user ranks to be combined with the given rank.
An array of combined ranks, where each element includes the given rank and the properties of a user rank.
verifyRank()
'Read the “', verifyRank(), '” section'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.
Parameters
'Read the “', Parameters, '” section'{
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.
permissions
'Read the “', permissions, '” section'{
rank
: string
;
user
: string
;
}[]
An array of permission objects that include user ranks.
string
The rank to be verified against the permissions.
An array of objects containing the id and name of users with the specified rank.
If an error occurs during the verification process.