Struggling to figure this out.. any tips would be helpful.

My app has Account, User, and Relationship models. Relationship model has a
relationship_type column that determines authorization level: "owner",
"moderator", etc...

I'm not how to scope the relationship model in the context of an account.
For example, one user can own two accounts, be a moderator on one, and a
guest on several others. I looked at CanCan, but it does not take my
approach to authorization; in that, the having an extra relationship_type
column in the Relationship model to determine authorization. So I'm not
sure if my approach is flawed...


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/QYcA2J6ONgUJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Colin Law at Mar 5, 2012 at 5:27 pm

    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Mohamad El-Husseini at Mar 5, 2012 at 8:56 pm
    Thanks, Colin. I figured it out. It turns out CanCan does support what I
    want.
    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin


    On Monday, March 5, 2012 2:26:29 PM UTC-3, Colin Law wrote:
    On 5 March 2012 17:19, Mohamad El-Husseini wrote:
    Struggling to figure this out.. any tips would be helpful.

    My app has Account, User, and Relationship models. Relationship model has a
    relationship_type column that determines authorization level: "owner",
    "moderator", etc...

    I'm not how to scope the relationship model in the context of an account.
    For example, one user can own two accounts, be a moderator on one, and a
    guest on several others. I looked at CanCan, but it does not take my
    approach to authorization; in that, the having an extra relationship_type
    column in the Relationship model to determine authorization. So I'm not sure
    if my approach is flawed...
    You have not explained (for me anyway) exactly what you are having
    difficulty with. Your models seem to do precisely what you want. Can
    you explain exactly what you cannot see how to do?

    Colin
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/zCLF3Ac31ccJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 5, '12 at 5:19p
activeMar 5, '12 at 8:56p
posts3
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Mohamad El-Husseini: 2 posts Colin Law: 1 post

People

Translate

site design / logo © 2021 Grokbase