lled by the secure tag:
>>>>>>
>>>>>> class RBACController(object):
>>>>>> global _ENFORCER
>>>>>> if not _ENFORCER:
>>>>>> _ENFORCER = policy.Enforcer()
>>>>>>
>>>>>
t; > > > > In check_permissions I'd like to know the class and method with
> > > > > the
> > @secure tag that caused check_permissions to be invoked. In this
> > case, that would be MetersController.get_all.
> > > > >
> &
he
> @secure tag that caused check_permissions to be invoked. In this case, that
> would be MetersController.get_all.
> > >>
> > >> Thanks
> > >>
> > >>
> > >>> Can you share some code? What do you mean by, "is there a way for the
>
gt;>>>
>>>>> Can you share some code? What do you mean by, "is there a way for the
> decorator code to know it was called by MetersController.get_all"
>>>>>
>>>>> On 08/12/14 04:46 PM, Pendergrass, Eric wrote:
>>>>>
> >>>
> >>> On 08/12/14 04:46 PM, Pendergrass, Eric wrote:
> >>>> Thanks Ryan, but for some reason the controller attribute is None:
> >>>>
> >>>> (Pdb) from pecan.core import state
> >>>> (Pdb) state.__dict_
tribute is None:
>>>>
>>>> (Pdb) from pecan.core import state
>>>> (Pdb) state.__dict__
>>>> {'hooks': [,
>>>> ,
>>>> ,
>>>> ], 'app':
>>>> , 'request': >>> 0x3ed7390 GET h
; > (Pdb) state.__dict__
> > > {'hooks': [,
> > > ,
> > > ,
> > > ], 'app':
> > > , 'request': > > 0x3ed7390 GET http://localhost:8777/v2/meters>, 'controller': None,
> > > 'response': }
>
> 'response': }
> >
> > > -Original Message-
> > > From: Ryan Petrello [mailto:ryan.petre...@dreamhost.com]
> > > Sent: Tuesday, August 12, 2014 10:34 AM
> > > To: OpenStack Development Mailing List (not for usage questions)
> > &
> > From: Ryan Petrello [mailto:ryan.petre...@dreamhost.com]
> > Sent: Tuesday, August 12, 2014 10:34 AM
> > To: OpenStack Development Mailing List (not for usage questions)
> > Subject: Re: [openstack-dev] [Ceilometer] Way to get wrapped method's
> > name/c
}
> -Original Message-
> From: Ryan Petrello [mailto:ryan.petre...@dreamhost.com]
> Sent: Tuesday, August 12, 2014 10:34 AM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [Ceilometer] Way to get wrapped method's
> name
This should give you what you need:
from pecan.core import state
state.controller
On 08/12/14 04:08 PM, Pendergrass, Eric wrote:
> Hi, I'm trying to use the built in secure decorator in Pecan for access
> control, and I'ld like to get the name of the method that is wrapped from
> within the dec
Do u know if ceilometer is using six.wraps?
If so, that helper adds in the `__wrapped__` attribute to decorated
methods (which can be used to find the original decorated function).
If just plain functools are used (and python3.x isn't used) then it
will be pretty hard afaik to find the origin
Hi, I'm trying to use the built in secure decorator in Pecan for access
control, and I'ld like to get the name of the method that is wrapped from
within the decorator.
For instance, if I'm wrapping MetersController.get_all with an @secure
decorator, is there a way for the decorator code to know
13 matches
Mail list logo