KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Academy Exercise 3.6

  • Exercise 3.6

    Posted by daramcs on September 18, 2023 at 12:00 am

    I am unsure where I am wrong with my .z.pg

    .z.pg:{[x] i: where .perm.users.user = .z.u;
    auth:.perm.users.api[first i];
    $[auth ~ `all;value x;.perm.parseQuery[x] ~ auth; value x; `notAuthorized]}

    when I define my .z.pg on the hdb, it breaks all the previous tests

     

     

     

     

     

    daramcs replied 9 months, 3 weeks ago 2 Members · 3 Replies
  • 3 Replies
  • gyorokpeter-kx

    Member
    September 18, 2023 at 12:00 am

    You have a keyed table in .perm.users. Dot syntax (.perm.users.user) doesn’t work for indexing in this case.

  • gyorokpeter-kx

    Member
    September 18, 2023 at 12:00 am

    From the error message, it seems to be complaining that .perm.users.user does not exist. Can you check if this is the case? The variable needs to be defined before the first invocation of .z.pg happens.

  • daramcs

    Member
    September 18, 2023 at 12:00 am

    It looks like .perm.users and users both exist in my hdb

     

     

Log in to reply.