fixes
This commit is contained in:
parent
1cbf78df3d
commit
aeb28833f1
8 changed files with 39 additions and 30 deletions
|
|
@ -99,8 +99,8 @@ class Ability
|
|||
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
|
||||
can :manage, SupporterLevel, conference_id: conf_ids_for_organizer
|
||||
can :manage, Target, conference_id: conf_ids_for_organizer
|
||||
can :manage, Commercial # , commercialable_type: 'Conference', commercialable_id: conf_ids_for_organizer
|
||||
can :index, Commercial, commercialable_type: 'Conference'
|
||||
can :manage, Commercial, commercialable_type: 'Conference', commercialable_id: conf_ids_for_organizer
|
||||
# Manage commercials for events that belong to a conference of which user is organizer
|
||||
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(conference_id: conf_ids_for_organizer + conf_ids_for_cfp).pluck(:id)
|
||||
can :manage, Contact, conference_id: conf_ids_for_organizer
|
||||
|
|
@ -114,6 +114,8 @@ class Ability
|
|||
conference.make_conference_public == true
|
||||
end
|
||||
|
||||
# see commercials too
|
||||
|
||||
can :show, Event do |event|
|
||||
event.state == 'confirmed'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -48,10 +48,6 @@ class User < ActiveRecord::Base
|
|||
user
|
||||
end
|
||||
|
||||
def get_roles
|
||||
roles
|
||||
end
|
||||
|
||||
def setup_role
|
||||
self.is_admin = true if User.count == 0
|
||||
end
|
||||
|
|
@ -59,7 +55,7 @@ class User < ActiveRecord::Base
|
|||
# Gets the roles of the user, groups them by role.name and returns the resource(s) of each role
|
||||
# ====Returns
|
||||
# * +Hash+ * -> e.g. 'organizer' => "(conf1, conf2)"
|
||||
def show_roles
|
||||
def get_roles
|
||||
result = {}
|
||||
Role::ACTIONABLES.each do |role|
|
||||
resources = self.roles.where(name: role.parameterize.underscore).map{ |myrole| Conference.find(myrole.resource_id).short_title }.join ', '
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue