Skip to content

Function: hasPermissions() ​

ts
function hasPermissions(
   userPerms, 
   required, 
   options?): boolean;

Checks whether the user has the required permissions. 判断用户是否拥有所需权限。

Parameters ​

ParameterTypeDescription
userPermsstring[] | undefinedUser's permission codes / 用户拥有的权限码列表
requiredstring[] | undefinedRequired permission codes / 需要校验的权限码列表
optionsHasPermissionsOptionsMatching options / 匹配选项

Returns ​

boolean

true if authorized / 授权通过时返回 true

Since ​

1.3.0

Released under the MIT License.