sdk/lib/users
Esta página aún no está disponible en tu idioma.
Functions
Section titled “Functions”combineRanks()
Section titled “combineRanks()”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
Section titled “Parameters”string
The rank to be combined with each user.
An array of user ranks to be combined with the given rank.
Returns
Section titled “Returns”An array of combined ranks, where each element includes the given rank and the properties of a user rank.
verifyRank()
Section titled “verifyRank()”function verifyRank( users: { avatar: null | string; createdAt: null | Date; email: null | string; emailVerified: boolean; id: string; name: string; notifications: null | 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
Section titled “Parameters”{
avatar
: null
| string
;
createdAt
: null
| Date
;
email
: null
| string
;
emailVerified
: boolean
;
id
: string
;
name
: string
;
notifications
: null
| string
;
password
: null
| string
;
updatedAt
: null
| Date
;
url
: null
| string
;
username
: string
;
}[]
An array of user objects to be verified.
permissions
Section titled “permissions”{
rank
: string
;
user
: string
;
}[]
An array of permission objects that include user ranks.
string
The rank to be verified against the permissions.
Returns
Section titled “Returns”An array of objects containing the id and name of users with the specified rank.
Throws
Section titled “Throws”If an error occurs during the verification process.