Policy indexes
If a request were as follows,
request schema
subject,object ,action
request
alice, /cgi/booking/12234/view, read
Basic Index
If we have an index for the subject attribute, we only need to enforce the following highlighting policy.
(i.e. search the index where sub == alice
)
** p, alice, /cgi/booking/*/view, (read|write) **
p, bob , /cgi/booking/*/view, read
p, chrome, /cgi/booking/*/view, read
p, foobar, /cgi/booking/*/view, read
** p, alice , /cgi/booking/*/trace, read **
p, bob , /cgi/booking/*/trace, read
p, chrome, /cgi/booking/*/trace, read
** p, alice , /cgi/booking/*/trace, read **
p, bob , /cgi/booking/*/trace, read
p, chrome, /cgi/booking/*/trace, read
Match with regex
If we have an Index for the object attribute, we only need to enforce the following highlighting policy.
(i.e. search the index where regex(obj,/cgi/booking/12234/view, read)
)
Note: This needs to support * wildcards and route-matching-like wildcards (such as:id, {id})
** p, alice , /cgi/booking/*/view, read **
** p, bob , /cgi/booking/*/view, read **
** p, chrome, /cgi/booking/*/view, read **
** p, foobar, /cgi/booking/*/view, read **
p, alice , /cgi/booking/*/trace, read
p, bob , /cgi/booking/*/trace, read
p, chrome, /cgi/booking/*/trace, read
p, alice , /cgi/booking/*/trace, read
p, bob , /cgi/booking/*/trace, read
p, chrome, /cgi/booking/*/trace, read