Resource constructor

Resource(
  1. ResourceType type, {
  2. String? name,
  3. String? pattern,
  4. bool? create = false,
  5. bool? delete = false,
  6. bool? manage = false,
  7. bool? read = false,
  8. bool? write = false,
  9. bool? get = false,
  10. bool? update = false,
  11. bool? join = false,
  12. int bit = 0,
})

Implementation

Resource(this.type,
    {this.name,
    this.pattern,
    bool? create = false,
    bool? delete = false,
    bool? manage = false,
    bool? read = false,
    bool? write = false,
    bool? get = false,
    bool? update = false,
    bool? join = false,
    int bit = 0})
    : _bit = bit {
  if (join == true) _bit |= 128;
  if (update == true) _bit |= 64;
  if (get == true) _bit |= 32;
  if (create == true) _bit |= 16;
  if (delete == true) _bit |= 8;
  if (manage == true) _bit |= 4;
  if (write == true) _bit |= 2;
  if (read == true) _bit |= 1;
}