Is there a way in the permissions and associations system to use
"user_id" and current_user instead of "owner_id" and Owner
associations (acting_user == owner, owner_is?(acting_user), etc) ...
using user_id and owner_id in every record seems redundant, or am I
thinking about this in the wrong way?

>From what you all have said, I need to re-define the model to return
current_user records in the controller class and in the model class
use owner associations in the permissions system .... is there a more
complete working application example that you could point me to, as
the Agility tutorial doesn't quite show how this would all work
together in the best manner and I'm having a hard time understanding
the logistics of such a system. It's such a common design pattern that
each user can only manipulate records that belong to them that I'm
sure this must be fairly straightforward.

thanks,
Jeremy

On Apr 12, 6:13 pm, kevinpfromnm <[email protected]> wrote:
> You should set the permissions as appropriate but still setting the
> finder action makes the pagination work better and gives accurate
> total results.
>
> On Apr 12, 1:53 pm, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > So after going through the agility tutorial, it does seem that I can
> > do what I want just by using the permissions system, by using owner_id
> > and the associated methods and checks for owner and acting_user
> > instead of using current_user and user_id in my models ... which is
> > fine.
>
> > It is all a bit much to take in, going to need to spend some time
> > learning the permission system better.
>
> > --jeremy
>
> > On Apr 7, 12:01 pm, Matt Jones <[email protected]> wrote:
>
> > > On Apr 7, 2010, at 11:06 AM, [email protected] wrote:
>
> > > > Thanks Matt, that actually helps a lot !
>
> > > > One thing though, I no longer have the "New Task" link present on my
> > > > tasks tab in the application, whether I'm the administrator or another
> > > > user, and I get a stack trace when trying to access the tasks tab when
> > > > I am the guest user. When I comment out the lines added, the link
> > > > comes back ...
>
> > > I'm guessing it's a permissions issue, yes. I'll take a look at it  
> > > this evening. The stack trace is likely because the Guest model  
> > > doesn't have a tasks association. On the other hand, I would have  
> > > assumed that you'd have set :login_required as a before_filter on that  
> > > page anyways, given the user-specific behavior.
>
> > > > I'm a total newb to Hobo and fairly new to rails (flex/php background)
> > > > so if these questions and their answers seem obvious please excuse my
> > > > ignorance ... thanks again --- this is really great stuff !!
>
> > > '
> > > No worries - the permissions code can be some of the trickiest stuff  
> > > to get right. It can be annoying when you change a permission method  
> > > and something important vanishes from a page.
>
> > > --Matt Jones

-- 
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