Hi Henry,

I have not tried this, but I would suggest checking what fields have
changed in the permission checks. Something like:

if only_changed?(:state, :my_special_attribute) && state == 'my_new_state'
  return true
elsif ...
  return true
else
  return false
end

You could also override permissions in the controller by using
"update_attribute", but that would not be very nice.

If if doesn't work, please write back and we'll try to figure out
another way :).

Warm regards,
Ignacio

El 24/02/14 15:50, Henry Baragar escribió:
> Hello,
> 
> I have a model that has some fields that should be changed only through
> a lifecycle change.  If I set up the permissions to prevent updates,
> then the permission system prevents the fields from being updated during
> the transition.  A couple of questions:
> 
>  1. Is there an attribute that indicates that the permissions check is
>     part of a transition? 
>       * It appears that "<transition>_in_progress?" has already been
>         reset before the transition block starts.
>       * NB that ":on" provides this functionality for validations
>  2. Is there a method for temporarily turning off permission checks?
>  3. Is there a method for bypassing permission checks?
> 
> What is the best way to do this?
> 
> Regards,
> Henry
> 
> -- 
> Henry Baragar
> Instantiated Software Inc.
> http://www.instantiated.ca
> 

-- 
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to