toJSON method

dynamic toJSON()

Implementation

dynamic toJSON() {
  if (allow == null && deny == null) {
    throw InvalidParameterException('You must specify the authorisation or prohibition');
  }

  return {
    'id': id,
    'type': type.value,
    'allow': allow != null ? Helper.reduceRolePermissions(allow!).toString() : null,
    'deny': deny != null ? Helper.reduceRolePermissions(deny!).toString() : null
  };
}