Fix getting push access data on settings reload
This commit is contained in:
parent
1570935099
commit
13ce7f88bd
|
@ -54,6 +54,12 @@ User = Model.extend
|
||||||
permissions
|
permissions
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
|
# TODO: permissions are loading asynchronously at the moment, so this should
|
||||||
|
# be the way to return them for all types:
|
||||||
|
pushPermissionsPromise: (->
|
||||||
|
@get('_rawPermissions').then (data) => data.pull
|
||||||
|
).property()
|
||||||
|
|
||||||
hasAccessToRepo: (repo) ->
|
hasAccessToRepo: (repo) ->
|
||||||
id = if repo.get then repo.get('id') else repo
|
id = if repo.get then repo.get('id') else repo
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,10 @@ Route = TravisRoute.extend
|
||||||
);
|
);
|
||||||
|
|
||||||
hasPushAccess: ->
|
hasPushAccess: ->
|
||||||
repoId = parseInt @modelFor('repo').get('id')
|
repoId = parseInt(@modelFor('repo').get('id'))
|
||||||
|
|
||||||
@auth.get('currentUser').get('pushPermissions').filter (item) ->
|
@auth.get('currentUser').get('pushPermissionsPromise').then (permissions) ->
|
||||||
|
permissions.filter (item) ->
|
||||||
item == repoId
|
item == repoId
|
||||||
|
|
||||||
model: () ->
|
model: () ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user