Skip to content

Commit

Permalink
Merge pull request maestrano#202 from fgourichon/mnoe-464
Browse files Browse the repository at this point in the history
[MNOE-464] - Remove connect button for non admin users
  • Loading branch information
alexnoox authored Jun 6, 2017
2 parents 9065ccb + d801534 commit ea33178
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/components/mnoe-api/organizations.svc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,8 @@ angular.module 'mnoEnterpriseAngular'
organizationSettings: (obj = null) -> _self.can.create.organizationSettings(obj) # call similar permission
}

_self.can.connect = {
appInstance: -> _self.role.atLeastAdmin()
}

return @
3 changes: 3 additions & 0 deletions src/app/views/apps/dashboard-apps-list.controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ angular.module 'mnoEnterpriseAngular'
$scope.helper.displayCogwheel = ->
MnoeOrganizations.can.update.appInstance()

$scope.helper.canConnectApp = ->
MnoeOrganizations.can.connect.appInstance()

$scope.helper.canRenameApp = ->
MnoeOrganizations.can.update.appInstance()

Expand Down
2 changes: 1 addition & 1 deletion src/app/views/apps/dashboard-apps-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h2 class="section-title">
</div>

<!-- OAuth Connect Button -->
<div ng-show="helper.isOauthConnectBtnShown(app)">
<div ng-show="helper.isOauthConnectBtnShown(app) && helper.canConnectApp()">
<a class="btn btn-warning" href="" ng-click="helper.oAuthConnectPath(app)">
{{ 'mno_enterprise.templates.dashboard.apps_list.connect' | translate }}
</a>
Expand Down

0 comments on commit ea33178

Please sign in to comment.