def request_user_has_rule_trigger_permission(request, trigger):
 if (not cfg.CONF.rbac.enable):
  return True
 user_db = get_user_db_from_request(request=request)
 rules_resolver = resolvers.get_resolver_for_resource_type(ResourceType.RULE)
 has_trigger_permission = rules_resolver.user_has_trigger_permission(user_db=user_db, trigger=trigger)
 if has_trigger_permission:
  return True
 return False

def request_user_has_rule_trigger_permission ( request , trigger ) : if ( not cfg . CONF . rbac . enable ) : return True user_db = get_user_db_from_request ( request = request ) rules_resolver = resolvers . get_resolver_for_resource_type ( ResourceType . RULE ) has_trigger_permission = rules_resolver . user_has_trigger_permission ( user_db = user_db , trigger = trigger ) if has_trigger_permission : return True return False
check that the currently logged-in has necessary permissions on the trigger used / referenced inside the rule .