hasPerms method

  1. @override
Future<bool> hasPerms({
  1. required String doctype,
  2. required List<PermissionType> pTypes,
  3. String? docname,
})
override

Similar to hasPerm with the key difference that it can accept a list of perms pTypes.

If one of the perms is not allowed, the method returns false.

Implementation

@override
Future<bool> hasPerms(
    {required String doctype,
    required List<PermissionType> pTypes,
    String? docname}) async {
  for (final pType in pTypes) {
    final hasPerm = await this.hasPerm(
        doctype: doctype, pType: pType, permLevel: 0, docname: docname);
    if (!hasPerm) {
      return false;
    }
  }
  return true;
}