check for canEditFeaturedLists permission editing lists, fixes #377
This commit is contained in:
parent
525fab0400
commit
e0dc7b48e9
2 changed files with 9 additions and 2 deletions
|
@ -1041,6 +1041,10 @@ class Item(models.Model):
|
|||
if streams.count() > 1:
|
||||
timelines = [s.timeline_prefix for s in self.streams()]
|
||||
join_timelines(timelines, self.timeline_prefix)
|
||||
else:
|
||||
#remove joined timeline if it was created at some point
|
||||
for f in glob(os.path.join(settings.MEDIA_ROOT, self.path(), 'timeline*.png')):
|
||||
os.unlink(f)
|
||||
|
||||
def make_poster(self, force=False):
|
||||
ox.makedirs(os.path.join(settings.MEDIA_ROOT,self.path()))
|
||||
|
|
|
@ -91,8 +91,11 @@ class List(models.Model):
|
|||
return self.user == user or self.status in ('public', 'featured')
|
||||
|
||||
def editable(self, user):
|
||||
#FIXME: make permissions work
|
||||
if self.user == user or user.is_staff:
|
||||
if user.is_anonymous():
|
||||
return False
|
||||
if self.user == user or \
|
||||
user.is_staff or \
|
||||
user.get_profile().capability('canEditFeaturedLists') == True:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in a new issue