add method

void add(
  1. ResourceType type, {
  2. String? name,
  3. String? pattern,
  4. bool? create,
  5. bool? delete,
  6. bool? manage,
  7. bool? read,
  8. bool? write,
  9. bool? get,
  10. bool? update,
  11. bool? join,
})

Adds new resource to this token request.

name can either be a String or a RegExp.

  • If name is a String, it adds a normal resource.
  • If name is a RegExp, it adds a pattern instead.

Implementation

void add(ResourceType type,
    {String? name,
    String? pattern,
    bool? create,
    bool? delete,
    bool? manage,
    bool? read,
    bool? write,
    bool? get,
    bool? update,
    bool? join}) {
  _resources.add(Resource(type,
      name: name,
      pattern: pattern,
      create: create,
      delete: delete,
      manage: manage,
      read: read,
      write: write,
      get: get,
      update: update,
      join: join));
}