diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-12-15 03:59:04 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-12-20 00:27:08 +0300 |
commit | 3db5b7033b13c21b904a21f751bc0f19156ea155 (patch) | |
tree | 0f5cfa65887744bb352dded9960217ae6df86ff5 /app/serializers/environment_entity.rb | |
parent | c3d972f4e861059312c2708dacb57999416fcc70 (diff) |
Add terminal UI and controller actions
Diffstat (limited to 'app/serializers/environment_entity.rb')
-rw-r--r-- | app/serializers/environment_entity.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb index e7ef01258ef..5d15eb8d3d3 100644 --- a/app/serializers/environment_entity.rb +++ b/app/serializers/environment_entity.rb @@ -8,7 +8,6 @@ class EnvironmentEntity < Grape::Entity expose :environment_type expose :last_deployment, using: DeploymentEntity expose :stoppable? - expose :has_terminals?, as: :has_terminals expose :environment_path do |environment| namespace_project_environment_path( @@ -25,10 +24,11 @@ class EnvironmentEntity < Grape::Entity end expose :terminal_path, if: ->(environment, _) { environment.has_terminals? } do |environment| - terminal_namespace_project_environment_path( - environment.project.namespace, - environment.project, - environment) + can?(request.user, :admin_environment, environment.project) && + terminal_namespace_project_environment_path( + environment.project.namespace, + environment.project, + environment) end expose :created_at, :updated_at |