Allow all employees to distinguish as admin.

This commit is contained in:
Ricky Ramirez
2013-08-08 14:21:02 -07:00
parent 75da61704b
commit ad2d41f7e7
3 changed files with 8 additions and 5 deletions

View File

@@ -96,7 +96,10 @@ class LinkButtons(PrintableButtons):
# do we show the distinguish button? among other things,
# we never want it to appear on link listings -- only
# comments pages
show_distinguish = (is_author and (thing.can_ban or c.user_special_distinguish)
show_distinguish = (is_author and
(thing.can_ban or # Moderator distinguish
c.user.employee or # Admin distinguish
c.user_special_distinguish)
and getattr(thing, "expand_children", False))
kw = {}

View File

@@ -934,9 +934,7 @@ class VSrModerator(Validator):
class VCanDistinguish(VByName):
def run(self, thing_name, how):
if c.user_is_admin:
return True
elif c.user_is_loggedin:
if c.user_is_loggedin:
item = VByName.run(self, thing_name)
if item.author_id == c.user._id:
# will throw a legitimate 500 if this isn't a link or
@@ -947,6 +945,8 @@ class VCanDistinguish(VByName):
return True
elif how in ("special", "no") and c.user_special_distinguish:
return True
elif how in ("admin", "no") and c.user.employee:
return True
abort(403,'forbidden')

View File

@@ -99,7 +99,7 @@
${distinguish_setter('no')}
 
%if c.user_is_admin:
%if c.user.employee:
/ 
${distinguish_setter('admin')}