-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
Version Information
Server Version:v2.12.0-cloud.1
Environment
Cloud
What is the current behaviour?
In permissions builder, while writing custom check, when comparing computed field(of boolean data type) value to boolean value (lets say true or false), it results into casting true to string type("true") rather than actual boolean type.
let's say I've this custom sql function of return type of bool
CREATE OR REPLACE FUNCTION public."ageExceedsCriteria"(user_row users)
RETURNS bool
LANGUAGE plpgsql
STABLE
AS $function$
BEGIN
return user_row.age > 40;
END;
$function$Then I create a computed field(for e.g., isAgeAbove40), and I assigned this function to it. Now when I compare it to true in permissions builder, it results into {"isAgeAbove40":{"_eq":"true"}}
What is the expected behaviour?
It should allow to compare to actual boolean value of true (which happens in case of non-computed fields having boolean type)
How to reproduce the issue?
- First, I created a custom sql function with return type of "bool"(boolean). This returns the expression which results into true or false.
- I created a computed field in existing table and assigned this custom sql function to it (which has return type of boolean)
- Now when I am trying to set up permissions for that computed field, lets say I want to check if computed field value is equal to true (This results into comparing value to string value of "true".
{"isAgeAbove40":{"_eq":"true"}})
Screenshots or Screencast
Keywords
computed field permissions boolean