resource property

String get resource

The resource segment, e.g. 'posts' from 'posts:read'.

Implementation

String get resource {
  final colon = key.indexOf(':');
  return colon == -1 ? key : key.substring(0, colon);
}