Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:parklab/refinery-platform into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
ngehlenborg committed Jun 22, 2015
2 parents 9de2943 + f6b9fc0 commit acc2dfa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions refinery/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def groups_with_user(self, user):
def has_access(self, user, res):
for i in self.groups_with_user(user):
perms = self.get_perms(res, i)
owner = res.get_owner()

if owner and owner.id == user.id:
return True

if perms['read'] or perms['change'] or res.is_public():
return True

Expand Down Expand Up @@ -115,10 +120,11 @@ def do_filtering(self, res_list, get_req_dict):
# Turns on certain things depending on flags
def build_res_list(self, user, res_list, request, **kwargs):
for i in res_list:
own = i.get_owner()
setattr(i, 'public', i.is_public())
setattr(i, 'owner_id', i.get_owner().id)
setattr(i, 'is_owner', i.get_owner().id == user.id)
setattr(i, 'owner_username', i.get_owner().username)
setattr(i, 'owner_id', None if own is None else own.id)
setattr(i, 'is_owner', None if own is None else own.id == user.id)
setattr(i, 'owner_username', None if own is None else own.username)

if 'sharing' in kwargs and kwargs['sharing']:
setattr(i, 'share_list', self.get_share_list(user, i))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ AnalysisMonitor.prototype.cancelAnalysis = function(successCallback,errorCallbac
$.ajax({
url: self.baseUrl + "/analysis_manager/analysis_cancel/",
type:"POST",
dataType: "json",
data: { csrfmiddlewaretoken: self.crsfMiddlewareToken, uuid: self.uuid },
success: function( result ) {
successCallback( result );
Expand Down

0 comments on commit acc2dfa

Please sign in to comment.