You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "anu238 ." <an...@gmail.com> on 2015/12/16 23:37:07 UTC

Query on validation and restricting access to users

Hi All,
I  have question on how I can add validation to a value of an entity field
as well as how I can add restriction to users on which entities they can
access using apache onlingo.

For Validation say for example I have a field emailaddress in entity users
table. I want to make sure that user supplied email address say in my case
follows this  regex pattern  \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b.
Does olingo supports data validation if so how can I use it.
Also I would like restrict access to some entities I have defined to a
subset of users in my domain how can I do that.
Thanks for your help in advance.
Best,
Anurag

Re: Query on validation and restricting access to users

Posted by mibo <mi...@apache.org>.
Hi Anurag,


you can add such validation after Olingo has deserialized your (e.g. POST) request into a HashMap (Olingo V2) or the Entity object (Olingo V4).
For access restriction Olingo does not provide any support, this must be provided by the environment (e.g. JEE server) or implemented by the service developer.


Best Regards,
Michael










> On Dec 17, 2015, at 6:52 PM, anu238 . <an...@gmail.com> wrote:
> 
> 
> Michael and Mibo thanks a lot for your reply. How/Where I can add hooks to the existing code in olingo so that I can add more complex validations.Also how can I restrict  access to entities to only a subset of users. 
> Thanks in advance for your help.
> Best,
> Anurag
> 
> 
> On Thu, Dec 17, 2015 at 6:18 AM, Michael <mibo@apache.org
>>wrote:
>> Hi Anurag,
>> 
>> just for clarification, OData and Olingo does not restrict a more
>> complex sort of property validation.
>> It is just that the service developer has to do the validation by
>> theme self (e.g. in the service/server).
>> 
>> Best Regards,
>> Michael
>> 
>> On Thu, Dec 17, 2015 at 7:36 AM, mibo <mibo@apache.org
>>> wrote:
>>> Hi Anurag,
>>>
>>> OData provides only a basic data validation via the facet [1] for a
>>> property.
>>> However more complex validation via e.g. a regex is not supported (by
>>> default).
>>>
>>> Best Regards,
>>> Michael
>>>
>>>
>>> [1]:
>>> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397954
>> 
>>>
>>>
>>>
>>> On Dec 16, 2015, at 11:37 PM, anu238 . <anurag.gujral@gmail.com
>>> wrote:
>>>
>>> Hi All,
>>> I  have question on how I can add validation to a value of an entity field
>>> as well as how I can add restriction to users on which entities they can
>>> access using apache onlingo.
>>>
>>> For Validation say for example I have a field emailaddress in entity users
>>> table. I want to make sure that user supplied email address say in my case
>>> follows this  regex pattern  \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b.
>>> Does olingo supports data validation if so how can I use it.
>>> Also I would like restrict access to some entities I have defined to a
>>> subset of users in my domain how can I do that.
>>> Thanks for your help in advance.
>>> Best,
>>> Anurag
>> 
>> 
>> 
> 
> 
> 

Re: Query on validation and restricting access to users

Posted by "anu238 ." <an...@gmail.com>.
Michael and Mibo thanks a lot for your reply. How/Where I can add hooks to
the existing code in olingo so that I can add more complex validations.
Also how can I restrict  access to entities to only a subset of users.
Thanks in advance for your help.
Best,
Anurag

On Thu, Dec 17, 2015 at 6:18 AM, Michael <mi...@apache.org> wrote:

> Hi Anurag,
>
> just for clarification, OData and Olingo does not restrict a more
> complex sort of property validation.
> It is just that the service developer has to do the validation by
> theme self (e.g. in the service/server).
>
> Best Regards,
> Michael
>
> On Thu, Dec 17, 2015 at 7:36 AM, mibo <mi...@apache.org> wrote:
> > Hi Anurag,
> >
> > OData provides only a basic data validation via the facet [1] for a
> > property.
> > However more complex validation via e.g. a regex is not supported (by
> > default).
> >
> > Best Regards,
> > Michael
> >
> >
> > [1]:
> >
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397954
> >
> >
> >
> > On Dec 16, 2015, at 11:37 PM, anu238 . <an...@gmail.com> wrote:
> >
> > Hi All,
> > I  have question on how I can add validation to a value of an entity
> field
> > as well as how I can add restriction to users on which entities they can
> > access using apache onlingo.
> >
> > For Validation say for example I have a field emailaddress in entity
> users
> > table. I want to make sure that user supplied email address say in my
> case
> > follows this  regex pattern  \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b.
> > Does olingo supports data validation if so how can I use it.
> > Also I would like restrict access to some entities I have defined to a
> > subset of users in my domain how can I do that.
> > Thanks for your help in advance.
> > Best,
> > Anurag
>

Re: Query on validation and restricting access to users

Posted by Michael <mi...@apache.org>.
Hi Anurag,

just for clarification, OData and Olingo does not restrict a more
complex sort of property validation.
It is just that the service developer has to do the validation by
theme self (e.g. in the service/server).

Best Regards,
Michael

On Thu, Dec 17, 2015 at 7:36 AM, mibo <mi...@apache.org> wrote:
> Hi Anurag,
>
> OData provides only a basic data validation via the facet [1] for a
> property.
> However more complex validation via e.g. a regex is not supported (by
> default).
>
> Best Regards,
> Michael
>
>
> [1]:
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397954
>
>
>
> On Dec 16, 2015, at 11:37 PM, anu238 . <an...@gmail.com> wrote:
>
> Hi All,
> I  have question on how I can add validation to a value of an entity field
> as well as how I can add restriction to users on which entities they can
> access using apache onlingo.
>
> For Validation say for example I have a field emailaddress in entity users
> table. I want to make sure that user supplied email address say in my case
> follows this  regex pattern  \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b.
> Does olingo supports data validation if so how can I use it.
> Also I would like restrict access to some entities I have defined to a
> subset of users in my domain how can I do that.
> Thanks for your help in advance.
> Best,
> Anurag

Re: Query on validation and restricting access to users

Posted by mibo <mi...@apache.org>.
Hi Anurag,


OData provides only a basic data validation via the facet [1] for a property.
However more complex validation via e.g. a regex is not supported (by default).


Best Regards,
Michael





[1]: http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397954








> On Dec 16, 2015, at 11:37 PM, anu238 . <an...@gmail.com> wrote:
> 
> 
> Hi All,I  have question on how I can add validation to a value of an entity field as well as how I can add restriction to users on which entities they can access using apache onlingo.
> 
> 
> For Validation say for example I have a field emailaddress in entity users table. I want to make sure that user supplied email address say in my case follows this  regex pattern  \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b
> .   Does olingo supports data validation if so how can I use it.
> Also I would like restrict access to some entities I have defined to a subset of users in my domain how can I do that.
> Thanks for your help in advance.
> Best,
> Anurag
>