Hi there!
I have to enable only products and orders in the admin module for users
belonging to a manager role. I added a new ability with the following lines

can :manage, Spree::Product
can :manage, Spree::Order

The product page loads fine but I get an unauthorized error in the orders
page. What permissions are needed to load the Orders page? I'm on
1-3-stable branch.

-Sriram

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Michael Sevestre at Feb 27, 2013 at 3:49 pm
    Good catch Stéphane.
    For the sake of understanding the bug : Why passing params[:action] does
    not work?

    Cheers,
    Michael

    On Wed, Feb 27, 2013 at 2:41 PM, Stéphane Bounmy
    wrote:
    Hi Sriram,

    I also had this issue this week-end.

    This is because params[:action] passed to cancan methods is not a symlink.

    You can checkout my pull request :
    https://github.com/spree/spree/pull/2609

    Stéphane.

    On Feb 27, 2013, at 1:31 PM, Sriram Balasubramanian wrote:

    Hi there!
    I have to enable only products and orders in the admin module for users
    belonging to a manager role. I added a new ability with the following lines

    can :manage, Spree::Product
    can :manage, Spree::Order

    The product page loads fine but I get an unauthorized error in the orders
    page. What permissions are needed to load the Orders page? I'm on
    1-3-stable branch.

    -Sriram

    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.




    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ryan Bigg at Feb 27, 2013 at 3:52 pm
    Because internally, CanCan compares params[:action] (a String) with the
    defined permission (a Symbol) and obviously "this" != :this, so the
    permission check fails.

    On Wed, Feb 27, 2013 at 10:49 AM, Michael Sevestre wrote:

    Good catch Stéphane.
    For the sake of understanding the bug : Why passing params[:action] does
    not work?

    Cheers,
    Michael


    On Wed, Feb 27, 2013 at 2:41 PM, Stéphane Bounmy <stephanebounmy@gmail.com
    wrote:
    Hi Sriram,

    I also had this issue this week-end.

    This is because params[:action] passed to cancan methods is not a symlink.

    You can checkout my pull request :
    https://github.com/spree/spree/pull/2609

    Stéphane.

    On Feb 27, 2013, at 1:31 PM, Sriram Balasubramanian <ramkalari@gmail.com>
    wrote:

    Hi there!
    I have to enable only products and orders in the admin module for users
    belonging to a manager role. I added a new ability with the following lines

    can :manage, Spree::Product
    can :manage, Spree::Order

    The product page loads fine but I get an unauthorized error in the orders
    page. What permissions are needed to load the Orders page? I'm on
    1-3-stable branch.

    -Sriram

    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.




    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups
    "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedFeb 27, '13 at 12:31p
activeFeb 27, '13 at 3:52p
posts3
users3
websitespreecommerce.com
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase