On Tuesday, May 8, 2012 4:56:26 PM UTC-5, Dennis wrote:
I would like to query/filter based on the beginning of a string in arrays,
like so:
Items stored look like:
{
"name":"some name",
"permissions":[
"group_resource_permission",
"group_resource_permission",
"group_resource_permission",
]
}
I want to defeat somebody who might name their domain/resource,
"group_targetGroup_resource_permission",
which if allowed, would allow them to match permission queries based on
'targetGroup' or 'targetGroup_resource_permission'.
Forcing the searched for string in a list of permissions to BEGIN at the
beginning of the string would be what I am after.
I COULD prefix each permission with a punctuation character, disallowing
it INSIDE of group, resource, or permission names, and may yet do that.
Ex.
{
"name":"some name",
"permissions":[
"~group_resource_permission",
"~group_resource_permission",
"~group_resource_permission",
]
}
AUTHORIZATION_ANCHOR="~";
AUTHORIZATION_ELEMENT_SEPARATOR="_";
Then queries/filters are post pended with an additional term for
permissions:
" AND " + AUTHORIZATION_ANCHOR + user.group() +
AUTHORIZATION_ELEMENT_SEPARATOR + Optional_resource +
AUTHORIZATION_ELEMENT_SEPARATOR + optional_permission;
But it's cooler and a good learning experience to gain the knowledge on
how to do it in a query/filter.
In any case, which will be faster, and which will use less memory, a query
based approach, or a filter based approach? (I don't need or want ranking
based on permissions).
On Tuesday, May 8, 2012 4:56:26 PM UTC-5, Dennis wrote:
I would like to query/filter based on the beginning of a string in arrays,
like so:
Items stored look like:
{
"name":"some name",
"permissions":[
"group_resource_permission",
"group_resource_permission",
"group_resource_permission",
]
}
I want to defeat somebody who might name their domain/resource,
"group_targetGroup_resource_permission",
which if allowed, would allow them to match permission queries based on
'targetGroup' or 'targetGroup_resource_permission'.
Forcing the searched for string in a list of permissions to BEGIN at the
beginning of the string would be what I am after.
I COULD prefix each permission with a punctuation character, disallowing
it INSIDE of group, resource, or permission names, and may yet do that.
Ex.
{
"name":"some name",
"permissions":[
"~group_resource_permission",
"~group_resource_permission",
"~group_resource_permission",
]
}
AUTHORIZATION_ANCHOR="~";
AUTHORIZATION_ELEMENT_SEPARATOR="_";
Then queries/filters are post pended with an additional term for
permissions:
" AND " + AUTHORIZATION_ANCHOR + user.group() +
AUTHORIZATION_ELEMENT_SEPARATOR + Optional_resource +
AUTHORIZATION_ELEMENT_SEPARATOR + optional_permission;
But it's cooler and a good learning experience to gain the knowledge on
how to do it in a query/filter.
In any case, which will be faster, and which will use less memory, a query
based approach, or a filter based approach? (I don't need or want ranking
based on permissions).
On Tuesday, May 8, 2012 4:56:26 PM UTC-5, Dennis wrote:
I would like to query/filter based on the beginning of a string in arrays,
like so:
Items stored look like:
{
"name":"some name",
"permissions":[
"group_resource_permission",
"group_resource_permission",
"group_resource_permission",
]
}
I want to defeat somebody who might name their domain/resource,
"group_targetGroup_resource_permission",
which if allowed, would allow them to match permission queries based on
'targetGroup' or 'targetGroup_resource_permission'.
Forcing the searched for string in a list of permissions to BEGIN at the
beginning of the string would be what I am after.
I COULD prefix each permission with a punctuation character, disallowing
it INSIDE of group, resource, or permission names, and may yet do that.
Ex.
{
"name":"some name",
"permissions":[
"~group_resource_permission",
"~group_resource_permission",
"~group_resource_permission",
]
}
AUTHORIZATION_ANCHOR="~";
AUTHORIZATION_ELEMENT_SEPARATOR="_";
Then queries/filters are post pended with an additional term for
permissions:
" AND " + AUTHORIZATION_ANCHOR + user.group() +
AUTHORIZATION_ELEMENT_SEPARATOR + Optional_resource +
AUTHORIZATION_ELEMENT_SEPARATOR + optional_permission;
But it's cooler and a good learning experience to gain the knowledge on
how to do it in a query/filter.
In any case, which will be faster, and which will use less memory, a query
based approach, or a filter based approach? (I don't need or want ranking
based on permissions).
On Tuesday, May 8, 2012 4:56:26 PM UTC-5, Dennis wrote:
I would like to query/filter based on the beginning of a string in arrays,
like so:
Items stored look like:
{
"name":"some name",
"permissions":[
"group_resource_permission",
"group_resource_permission",
"group_resource_permission",
]
}
I want to defeat somebody who might name their domain/resource,
"group_targetGroup_resource_permission",
which if allowed, would allow them to match permission queries based on
'targetGroup' or 'targetGroup_resource_permission'.
Forcing the searched for string in a list of permissions to BEGIN at the
beginning of the string would be what I am after.
I COULD prefix each permission with a punctuation character, disallowing
it INSIDE of group, resource, or permission names, and may yet do that.
Ex.
{
"name":"some name",
"permissions":[
"~group_resource_permission",
"~group_resource_permission",
"~group_resource_permission",
]
}
AUTHORIZATION_ANCHOR="~";
AUTHORIZATION_ELEMENT_SEPARATOR="_";
Then queries/filters are post pended with an additional term for
permissions:
" AND " + AUTHORIZATION_ANCHOR + user.group() +
AUTHORIZATION_ELEMENT_SEPARATOR + Optional_resource +
AUTHORIZATION_ELEMENT_SEPARATOR + optional_permission;
But it's cooler and a good learning experience to gain the knowledge on
how to do it in a query/filter.
In any case, which will be faster, and which will use less memory, a query
based approach, or a filter based approach? (I don't need or want ranking
based on permissions).