fix repo settings menu to not display the "regenerate key" item when user does not have admin access
This commit is contained in:
parent
776e3e9c3b
commit
8a3c05fe36
|
@ -141,10 +141,8 @@ Travis.reopen
|
||||||
error: ->
|
error: ->
|
||||||
Travis.lookup('controller:flash').loadFlashes([{ error: 'Travis encountered an error while trying to regenerate the key, please try again.'}])
|
Travis.lookup('controller:flash').loadFlashes([{ error: 'Travis encountered an error while trying to regenerate the key, please try again.'}])
|
||||||
|
|
||||||
displayRegenerateKey: true
|
|
||||||
|
|
||||||
canRegenerateKey: (->
|
canRegenerateKey: (->
|
||||||
@get('displayRegenerateKey') && @get('hasAdminPermission')
|
@get('hasAdminPermission')
|
||||||
).property('hasAdminPermission')
|
).property('hasAdminPermission')
|
||||||
|
|
||||||
hasPermission: (->
|
hasPermission: (->
|
||||||
|
@ -162,6 +160,10 @@ Travis.reopen
|
||||||
permissions.contains parseInt(@get('repo.id'))
|
permissions.contains parseInt(@get('repo.id'))
|
||||||
).property('currentUser.adminPermissions.length', 'repo.id')
|
).property('currentUser.adminPermissions.length', 'repo.id')
|
||||||
|
|
||||||
|
displayRegenerateKey: (->
|
||||||
|
@get('canRegenerateKey')
|
||||||
|
).property('canRegenerateKey')
|
||||||
|
|
||||||
displaySettingsLink: (->
|
displaySettingsLink: (->
|
||||||
@get('hasPushPermission')
|
@get('hasPushPermission')
|
||||||
).property('hasPushPermission')
|
).property('hasPushPermission')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user