You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@usergrid.apache.org by Alex T <ta...@mymacewan.ca> on 2014/11/05 18:28:15 UTC

Accessing collection without access tokens

Hi,

I was wondering for collections, is there a way to set that so that the 
data stored in the collection could be access without an access token?

What we want to do is allow users that have to "signed in" to be able to 
retrieve data stored within a particular collection.  Users that have 
signed in and obtained an access token would be able to retrieve and 
modify the data in the collection.

I am currently working on an app for android and am currently using 
Usergrid for the server side.

Thank you,
Alex

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


Re: Accessing collection without access tokens

Posted by Alex T <ta...@mymacewan.ca>.
Rod,

Ah alright that definitely helps.

Thank you,
Alex

On 05/11/2014 10:33 AM, Rod Simpson wrote:
> Alex,
>
> You can definitely do this with permissions / roles.
>
> There are several roles that are always created on a new app - Guest 
> and Default.  The Guest role is invoked when no token is present.  The 
> Default role is invoked when a token is present.
>
> So what you want to do is to create a permission in each role.  In the 
> Guest role, when users don’t have a token, create a role like this:
>
> GET /collection_name/*
>
> That will allow users without tokens to view the entities in the 
> collection.  Then, to the Default role, add this:
>
> GET, POST, PUT /collection_name/*
>
> This will allow users with a valid token to create, edit, and view 
> items in the collection.
>
> Rod
>
>
>
> -- 
> Rod Simpson
> @rockerston <https://twitter.com/rockerston>
> rodsimpson.com <http://rodsimpson.com/>
>
> On November 5, 2014 at 10:29:40 AM, Alex T (taia3@mymacewan.ca 
> <ma...@mymacewan.ca>) wrote:
>
>> Hi,
>>
>> I was wondering for collections, is there a way to set that so that the
>> data stored in the collection could be access without an access token?
>>
>> What we want to do is allow users that have to "signed in" to be able to
>> retrieve data stored within a particular collection. Users that have
>> signed in and obtained an access token would be able to retrieve and
>> modify the data in the collection.
>>
>> I am currently working on an app for android and am currently using
>> Usergrid for the server side.
>>
>> Thank you,
>> Alex
>>
>> ---
>> This email is free from viruses and malware because avast! Antivirus 
>> protection is active.
>> http://www.avast.com
>>



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Re: Accessing collection without access tokens

Posted by Rod Simpson <ro...@rodsimpson.com>.
Alex,

You can definitely do this with permissions / roles.

There are several roles that are always created on a new app - Guest and Default.  The Guest role is invoked when no token is present.  The Default role is invoked when a token is present.

So what you want to do is to create a permission in each role.  In the Guest role, when users don’t have a token, create a role like this:

GET /collection_name/*

That will allow users without tokens to view the entities in the collection.  Then, to the Default role, add this:

GET, POST, PUT /collection_name/*

This will allow users with a valid token to create, edit, and view items in the collection.

Rod



-- 
Rod Simpson
@rockerston
rodsimpson.com

On November 5, 2014 at 10:29:40 AM, Alex T (taia3@mymacewan.ca) wrote:

Hi,  

I was wondering for collections, is there a way to set that so that the  
data stored in the collection could be access without an access token?  

What we want to do is allow users that have to "signed in" to be able to  
retrieve data stored within a particular collection. Users that have  
signed in and obtained an access token would be able to retrieve and  
modify the data in the collection.  

I am currently working on an app for android and am currently using  
Usergrid for the server side.  

Thank you,  
Alex  

---  
This email is free from viruses and malware because avast! Antivirus protection is active.  
http://www.avast.com