module ArtfullyOse module CommonAbilities def box_office_associate sales checkin_on_door_list organization can :view, Show, { :organization_id => @user.current_organization.id } can [:view, :create], Search, { :organization_id => @user.current_organization.id } can [:create, :view_basic, :edit_basic], Person, { :organization_id => @user.current_organization.id } can :view, Event, { :organization_id => @user.current_organization.id } end def general_associate people checkin_on_door_list organization search advanced_search import reports segments settlements can :view, Order, { :organization_id => @user.current_organization.id } can :view, [Event, Show, Membership, Pass, Discount], { :organization_id => @user.current_organization.id } end def manager general_associate sales kits export orders charts can :view, User can :manage, [Event, Show, Membership, Pass, Discount], { :organization_id => @user.current_organization.id } end def organization_administrator manager # The generic permission to see if they can see the Users tab can :manage, User # The permission to see if they can edit user memberships in this org can :manage, UserMembership, { :organization_id => @user.current_organization.id } can :manage, Organization, { :id => @user.current_organization.id } end #### UTIL METHODS #### def sales can :manage, Sale end def checkin_on_door_list can :check_in, Ticket, { :organization_id => @user.current_organization.id } end def charts can :manage, Chart, { :organization_id => @user.current_organization.id } end def segments can :manage, Segment, { :organization_id => @user.current_organization.id } end def organization can :view, Organization, { :id => @user.current_organization.id } end def import can :manage, Import, { :organization_id => @user.current_organization.id } end def reports can :manage, :report end # # No class Export so had to use symbol # def export can :manage, :export end def search can :manage, Search, { :organization_id => @user.current_organization.id } end def advanced_search can :manage, AdvancedSearch do |search| search.organization == @user.current_organization end end def people can :manage, Person, { :organization_id => @user.current_organization.id } end def kits can :manage, Kit, { :organization_id => @user.current_organization.id } end def orders can :manage, Order, { :organization_id => @user.current_organization.id } end end end