getPrivilegeLevel static method

Future<PrivilegeLevel?> getPrivilegeLevel(
  1. AppModel app,
  2. MemberModel member,
  3. bool isOwner
)

Implementation

static Future<PrivilegeLevel?> getPrivilegeLevel(
    AppModel app, MemberModel member, bool isOwner) async {
  if (isOwner) return PrivilegeLevel.ownerPrivilege;
  var access =
      await accessRepository(appId: app.documentID)!.get(member.documentID);
  var privilegeLevel = access == null ? 0 : access.privilegeLevel;
  return privilegeLevel as Future<PrivilegeLevel?>;
  //return PrivilegeLevel.noPrivilege;
}