Page 2 of 2

Populate select menu with database?

Posted: Wed Jul 30, 2014 4:08 pm
by eascards

Shared!


Populate select menu with database?

Posted: Thu Jul 31, 2014 12:28 am
by Yurii Orishchuk

Hi Escards,

You have specific "acl" field value for these items: {"53c195ece4b04e2d7216ee98":{"read":true,"write":true}}

That means: only "53c195ece4b04e2d7216ee98" user can access these items.

So you have two ways:

1 Login with "53c195ece4b04e2d7216ee98" user and use list service with this user(pass sessionToken) to get these items.

2 Correct "acl" field with following value:

pre

{"53c195ece4b04e2d7216ee98":{"read":true,"write":true}, "*":{"read":true}}

/pre

Regards.


Populate select menu with database?

Posted: Thu Jul 31, 2014 4:04 am
by eascards

So if I try the second option of the two, where do I put that code? Probably the book create, right?

If so, do I completely get rid of the JS that is there and replace it with what is listed above or should I just replace the middle line of code? Image


Populate select menu with database?

Posted: Thu Jul 31, 2014 4:08 am
by eascards

Every user will have their code so how will it work to have only one user's code in the JS?


Populate select menu with database?

Posted: Thu Jul 31, 2014 10:00 pm
by Yurii Orishchuk

Hi eascards,

In your case you need to use following code:

pre

var acl = {};
acl[value] = {"read": true, "write" true};
acl["*"] = {"read": true};
return acl;

/pre

This code will add "*" section which is allows other users to read this item.

Regards.


Populate select menu with database?

Posted: Fri Aug 01, 2014 3:51 am
by eascards

I get this error when I use that code. Image

I want only the user that created the book to have access to it in the select menu so should I keep the code as it was?


Populate select menu with database?

Posted: Fri Aug 01, 2014 4:13 am
by Yurii Orishchuk

Eascards,

Use this code:

pre

var acl = {};
acl[value] = {"read": true, "write": true};
acl["*"] = {"read": true};
return acl;

/pre

Regards.


Populate select menu with database?

Posted: Fri Aug 01, 2014 4:27 am
by eascards

Yay!!! We got it!! After adding that code, I added an event to invoke the list service when the panel shows! Thanks for all of your hard work!