You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will be nice if Computed Field is supported too. So say if a user is only allowed to insert at most N rows to a table we can restrict that using an insert check i.e. by having a Computed Field like this to get the count:
CREATE OR REPLACE FUNCTION public.get_app_count(user_row user)
RETURNS integer
LANGUAGE plpgsql
STABLE
AS $function$
declare
app_count integer;
begin
select count(*)
into app_count
from app_profile
where app_profile.user.id = user.id;
return app_count;
end;
$function$
The text was updated successfully, but these errors were encountered:
archywillhe
changed the title
using computed_field as a column in check for permission
using Computed Field as a column in check for permission
Oct 21, 2020
Looks like right now only
PGColumn
is supported to be used as a column in check for permission. https://hasura.io/docs/1.0/graphql/core/auth/authorization/permission-rules.htmlWill be nice if
Computed Field
is supported too. So say if a user is only allowed to insert at most N rows to a table we can restrict that using an insert check i.e. by having aComputed Field
like this to get the count:related to - #4356
The text was updated successfully, but these errors were encountered: