[Rt-devel] Proposed change to RT::Principal::HasRight
Todd Chapman
todd at chaka.net
Tue Oct 11 16:27:15 EDT 2005
On Wed, Oct 12, 2005 at 12:46:24AM +0400, Ruslan Zakirov wrote:
> On 10/12/05, Todd Chapman <todd at chaka.net> wrote:
> > Principal::HasRight will return true regardless of the user
> > has been granted the right directly (ACLEquivalence), as
> > part of a group (UserDefined), or as part of a few
> > other group Domains.
> >
> > I would like to be able to ask RT if a user has the right
> > directly or as being part of a group.
> >
> > It's a simple patch to give HasRight a Domain list reference
> > option that default to the currently implemented functionality.
> >
> > Is there a better way to do this or should I write, test, and
> > submit a patch?
> Very bad idea, this sub is perfomance bottleneck and must be
> simplified instead of adding new functionality into it. You can scan
> groups for rights or do whatever magic you want, but don't touch this
> unless it has real bugs.
I don't think you understand what I am proposing. If HasRight is changed
as suggested it will run the same if the new option is default. If the
new option is specified, the query will be smaller and faster.
-Todd
More information about the Rt-devel
mailing list