Cap-go / CLI

CLI to help you to manage your version in capgo cloud
https://capgo.app
GNU Affero General Public License v3.0
14 stars 35 forks source link

is_app_owner -> is_allowed_action #184

Closed WcaleNieWolny closed 9 months ago

WcaleNieWolny commented 10 months ago

The is_app_owner fn is defined as

CREATE OR REPLACE FUNCTION "public"."is_app_owner"("userid" "uuid", "appid" character varying) RETURNS boolean
    LANGUAGE "plpgsql" SECURITY DEFINER
    AS $$
Begin
  RETURN (SELECT EXISTS (SELECT 1
  FROM apps
  WHERE app_id=appid
  AND user_id=userid));
End;  
$$;

But the CLI calls it as is_app_owner(apikey, appid) This causes the following postgress error image

By migrating to is_allowed_action everything works as it should. The is_allowed_action is defined as

CREATE OR REPLACE FUNCTION "public"."is_allowed_action"(apikey text, appid character varying)
sonarcloud[bot] commented 10 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

riderx commented 9 months ago

is is_allowed_action was a temporary test the right function is is_app_owner, it was not added to the seed but present in prod