actionToDemandOnPrincipal method

  1. @override
String actionToDemandOnPrincipal(
  1. DbPrincipal principal
)
override

Determines the action that shares the entity has for the user.

This method will return an empty string, meaning no share is required, in case the user has the permission. Otherwise, it will return actionToDemand.

Implementation

@override
String actionToDemandOnPrincipal(DbPrincipal principal) {
  return permission != '' && principal.hasPermission(permission)
      ? ''
      : actionToDemand;
}