fix repo settings menu to not display the "regenerate key" item when user does not have admin access

This commit is contained in:
Sven Fuchs 2014-12-10 15:23:09 +01:00 committed by Justine Arreche
parent 776e3e9c3b
commit 8a3c05fe36

View File

@ -141,10 +141,8 @@ Travis.reopen
error: ->
Travis.lookup('controller:flash').loadFlashes([{ error: 'Travis encountered an error while trying to regenerate the key, please try again.'}])
displayRegenerateKey: true
canRegenerateKey: (->
@get('displayRegenerateKey') && @get('hasAdminPermission')
@get('hasAdminPermission')
).property('hasAdminPermission')
hasPermission: (->
@ -162,6 +160,10 @@ Travis.reopen
permissions.contains parseInt(@get('repo.id'))
).property('currentUser.adminPermissions.length', 'repo.id')
displayRegenerateKey: (->
@get('canRegenerateKey')
).property('canRegenerateKey')
displaySettingsLink: (->
@get('hasPushPermission')
).property('hasPushPermission')