thanks, kevin. after a while longer failing to grasp the syntax of
named_scope, I finally found that the following works

named_scope :approver, :conditions => { :role => "manager" }

and then as you said the solution is

transition :advance, { :suspect => :to_bid } , :available_to =>
"User.decider"

phew - this has been on my todolist for over a week :-)

thanks again.

On 6 May, 22:29, kevinpfromnm <[email protected]> wrote:
> http://cookbook.hobocentral.net/manual/lifecycles#the__option
> is where it describes it in detail.
>
> my suggestion from another thread was to make a named_scope for the
> desired state and then use :available_to => "User.scope_name_here"
> which will allow if the user is a member of the collection.
>
> On May 6, 3:10 pm, storitel <[email protected]> wrote:
>
>
>
> > hi chaps
>
> > I know this is discussed in the agile tutorial, and both books but I'm
> > still completely flummoxed...
>
> > i've given my Users a role ie
>
> > class User < ActiveRecord::Base
>
> >   hobo_user_model
>
> >   fields do
> >     name   :string, :required, :unique
> >     role enum_string(:sales, :resourcing, :manager, :commercial)
> >   ....
>
> > so now in my Leads model which has a lifecycle, I want to allow a
> > transition only if acting_user.role == "manager"
>
> > my trials and errors have been unrewarded... can you help?
>
> > br
> > paul
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Hobo Users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/hobousers?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Hobo Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to