eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

Populate select menu with database?

Shared!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Populate select menu with database?

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.

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

Populate select menu with database?

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

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

Populate select menu with database?

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Populate select menu with database?

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.

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

Populate select menu with database?

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?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Populate select menu with database?

Eascards,

Use this code:

pre

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

/pre

Regards.

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

Populate select menu with database?

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!

Return to “Issues”