Skip to content

Commit

Permalink
changesets api - fix in getting environment for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Strachota committed Jan 6, 2012
1 parent fc98e99 commit affcd94
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/app/controllers/api/changesets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

class Api::ChangesetsController < Api::ApiController

before_filter :find_environment
before_filter :find_changeset, :only => [:show, :destroy, :promote, :dependencies]
before_filter :find_environment
before_filter :authorize

def rules
Expand Down Expand Up @@ -78,10 +78,6 @@ def find_environment
@environment = KTEnvironment.find(params[:environment_id])
raise HttpErrors::NotFound, _("Couldn't find environment '#{params[:environment_id]}'") if @environment.nil?
@environment
else
#didnt' find an environment, just do the first the user has access to
list = KTEnvironment.changesets_readable(current_organization).where(:locker=>false)
@environment ||= list.first || current_organization.locker
end
end

Expand Down

0 comments on commit affcd94

Please sign in to comment.