Skip to main content
Level 4
Jan 20, 2021 1:49 AM UTC
Question

Permission denied for table when querying in WebApp

Hi

in the Adobe campaign Classic v7. I am executing a query from the webapp when the user subscribe to get some reward code and inject into email . I am having permission issues when webapp trying to execute the query even though the webapp user have Administration rights( some time it works though) .. The webapp access control is set up as Anonymous access. The funny thing is that there is another query that gets execute fine. The table that is getting queried is under a custom schema .

below is the query that get executed

 

var query = xtk.queryDef.create( <queryDef schema="vb:promoCodes" operation="select" lineCount="1">
<select>
<node expr="@promoCode"/>
<node expr="@codeStartDate"/>
<node expr="@codeEndDate"/>
<node expr="@id"/>
</select>
<where>
<condition expr="@codeStartDate <= GetDate()"/>
<condition expr="@codeEndDate >= GetDate()"/>
</where>
</queryDef>)

var promoCodes = query.ExecuteQuery();

 

error below

Error | Function getpromoCode() failed | PGS-220000 PostgreSQL error: ERROR: permission denied for table vbpromocodes .

SOP-330011 Error while executing the method 'ExecuteQuery' of service 'xtk:queryDef'

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
Jan 20, 2021 7:20 PM UTC

Hi,

 

The error is coming from postgres there.

Check that Campaign's db user has read access to the vbpromocodes table.

 

Thanks,

-Jon

Translate
Level 4
Jan 21, 2021 1:26 PM UTC
Thanks Jon, The Schema was created from the AC UI as I dont have acess to the PostgreSQL. can the permissions assigned from the Campaign itself when the schema gets created?
Translate
saikatk2447661
Level 4
Feb 10, 2021 6:42 PM UTC

Hi @vendimb15716755 ,

 

Could you please explain the reason behind "Function getpromoCode()". Is @promoCode coming from a calculated field?

 

Thanks,

Saikat

Translate
Level 4
Mar 1, 2021 12:31 AM UTC
The Function getpromocode is coming from Javascript code. withing the webapp I am including reference to the javascript code that does all the logic. @promocode is not a calculated field. its just a column on a schema that holgs promo codes
Translate