Added backwards compatible way to do sanity checking on permissions and raise exceptions when you make a typo.

getting them from the roles is exactly what i mean

On 26 November 2014 at 14:00, Harro van der Klauw <notifications@github.com>
wrote:

> In balrog/policy.py:
>
> >
> >
> >  class Policy(object):
> >
> >      """Controls the access of a certain actor to a certain action on a resource."""
> >
> > -    def __init__(self, roles, get_identity, get_role):
> > +    def __init__(self, roles, get_identity, get_role, permissions=None):
>
> Yes, but this way you can NOT do the checking by not providing it. We
> could get them from the roles but we'll start raising exceptions while
> before we didn't.
> … <#149ec2ffe08c3170_>
> On 26 November 2014 at 13:57, Anatoly Bubenkov <notifications@github.com>
> wrote: In balrog/policy.py: > > > class Policy(object): > > """Controls the
> access of a certain actor to a certain action on a resource.""" > > - def
> __init__(self, roles, get_identity, get_role): > + def __init__(self,
> roles, get_identity, get_role, permissions=None): policy is able to get all
> possible permissions by itself there's no need to receive it as a parameter
> — Reply to this email directly or view it on GitHub <
> https://github.com/paylogic/balrog/pull/1/files#r20933058>.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/paylogic/balrog/pull/1/files#r20933170>.
>



-- 
Anatoly Bubenkov