#1: fix for specs, update ability for Platform

This commit is contained in:
Vokhmin Alexey V 2013-03-07 02:47:30 +04:00
parent 98891a9153
commit be9ada74cb
3 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class Api::V1::AdvisoriesController < Api::V1::BaseController
def find_and_authorize_build_list
@build_list = BuildList.find params[:build_list_id]
authorize! :update_advisory, @build_list.save_to_platform
authorize! :update_secondary, @build_list.save_to_platform
end
end

View File

@ -28,7 +28,7 @@ class Platforms::MassBuildsController < Platforms::BaseController
end
def index
authorize! :edit, @platform
authorize! :update_secondary, @platform
@mass_builds = MassBuild.by_platform(@platform).order('created_at DESC').paginate(:page => params[:page], :per_page => 20)
@auto_publish_selected = true

View File

@ -96,7 +96,7 @@ class Ability
can [:read, :related, :members], Platform, :owner_type => 'Group', :owner_id => user.group_ids
can([:read, :related, :members], Platform, read_relations_for('platforms')) {|platform| local_reader? platform}
can([:update, :destroy], Platform) {|platform| owner?(platform) }
can([:update_advisory, :members, :add_member, :remove_member, :remove_members] , Platform) {|platform| owner?(platform) || local_admin?(platform) }
can([:update_secondary, :members, :add_member, :remove_member, :remove_members] , Platform) {|platform| owner?(platform) || local_admin?(platform) }
can([:get_list, :create], MassBuild) {|mass_build| (owner?(mass_build.platform) || local_admin?(mass_build.platform)) && mass_build.platform.main?}
can(:cancel, MassBuild) {|mass_build| (owner?(mass_build.platform) || local_admin?(mass_build.platform)) && !mass_build.stop_build && mass_build.platform.main?}