OK, so you're not trying to find the value 'VIEW_ALL_CUSTS', you're
trying to find an object whose rightKey property is 'VIEW_ALL_CUSTS'.
Or at least find out if such an object exists. Your ArrayCollection is
holding object, not strings, so in your function you'd need to do
something like this:

for each(var obj:Object in userRights)
{
   if(obj.rightKey = 'VIEW_ALL_CUSTS')
   {
      return true;
   }
}
return false;

HTH,
Ben


--- In flexcoders@yahoogroups.com, "boy_trike" <[EMAIL PROTECTED]> wrote:
>
> Here is my problem.  I want to see if the user has the
VIEW_ALL_CUSTS rightkey.  When I 
> try:  
> model.userRights.contains('VIEW_ALL_CUSTS')
>  I always get a false.  It doesnt matter if I pad with extra spaces
to make the fields the 
> same size:  Following is what the data looks like:
> 
> userRights = mx.collections.ArrayCollection (@3aa5401)
>       [0] = Object (@40001a1)
>               Description = "I can see ALL customers                 "
>               rightKey = "VIEW_ALL_CUSTS      "
>       [1] = Object (@40001c1)
>               Description = "I have access to the purchasing system  "
>               rightKey = "ACCESS_PURCHASING   "
>       [2] = Object (@40001e1)
>               Description = "I can view / purchase all items         "
>               rightKey = "PURCHASE_ALL_ITEMS  "
> 
> 
> Bruce
> 
> --- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<ben.clinkinbeard@> wrote:
> >
> > ArrayCollection.contains()
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "boy_trike" <boy_trike@> wrote:
> > >
> > > My security system has a user rights table, which has a list of TEXT
> > > keys that each user has.  I am storing this in an arraycollection. 
> > > What I want to do is see if this key exists in the array
collection. 
> > > Is there an easy way to do this?
> > > 
> > > Thanks
> > > Bruce
> > >
> >
>


Reply via email to