changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r15616: LJSUP-4767

Committer: gprochaev
LJSUP-4767


U   trunk/cgi-bin/LJ/Console/Command/TagPermissions.pm
U   trunk/cgi-bin/taglib.pl
U   trunk/htdocs/manage/tags.bml
U   trunk/htdocs/manage/tags.bml.text
Modified: trunk/cgi-bin/LJ/Console/Command/TagPermissions.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/TagPermissions.pm	2009-08-20 03:24:07 UTC (rev 15615)
+++ trunk/cgi-bin/LJ/Console/Command/TagPermissions.pm	2009-08-20 09:24:50 UTC (rev 15616)
@@ -49,7 +49,7 @@
 
     my $validate_level = sub {
         my $level = shift;
-        return $level if $level =~ /^(?:private|public|none|friends)$/;
+        return $level if $level =~ /^(?:private|public|none|friends|author_moder)$/;
 
         my $grp = LJ::get_friend_group($foru, { name => $level });
         return "group:$grp->{groupnum}" if $grp;
@@ -59,7 +59,7 @@
 
     $add = $validate_level->($add);
     $control = $validate_level->($control);
-    return $self->error("Levels must be one of: 'private', 'public', 'friends', or the name of a friends group.")
+    return $self->error("Levels must be one of: 'private', 'public', 'friends', 'author_moder', or the name of a friends group.")
         unless $add && $control;
 
     $foru->set_prop('opt_tagpermissions', "$add,$control");

Modified: trunk/cgi-bin/taglib.pl
===================================================================
--- trunk/cgi-bin/taglib.pl	2009-08-20 03:24:07 UTC (rev 15615)
+++ trunk/cgi-bin/taglib.pl	2009-08-20 09:24:50 UTC (rev 15616)
@@ -509,6 +509,8 @@
         return 0;
     } elsif ($perm eq 'friends') {
         return LJ::is_friend($u, $remote);
+    } elsif ($perm eq 'author_moder') {
+        return LJ::is_friend($u, $remote) || LJ::can_manage($remote, $u);
     } elsif ($perm eq 'private') {
         return LJ::can_manage($remote, $u);
     } elsif ($perm =~ /^group:(\d+)$/) {

Modified: trunk/htdocs/manage/tags.bml
===================================================================
--- trunk/htdocs/manage/tags.bml	2009-08-20 03:24:07 UTC (rev 15615)
+++ trunk/htdocs/manage/tags.bml	2009-08-20 09:24:50 UTC (rev 15616)
@@ -63,8 +63,8 @@
             my $control = $POST{"control_level"};
 
             return LJ::bad_input($ML{'.error.invalidsettings'})
-               unless $add =~ /^(?:private|public|friends|group:\d+)$/ &&
-               $control =~ /^(?:private|public|friends|group:\d+)$/;
+               unless $add =~ /^(?:private|public|friends|group:\d+|author_moder)$/ &&
+               $control =~ /^(?:private|public|friends|group:\d+|author_moder)$/;
 
             $u->set_prop("opt_tagpermissions", "$add,$control");
         }
@@ -279,6 +279,7 @@
     } else {
         push @groups, ("friends", $ML{'.setting.members'});
         push @groups, ("private", $ML{'.setting.maintainers'});
+        push @groups, ("author_moder", $ML{'.setting.author'});
     }
 
     my $grouplist = LJ::get_friend_group($u);

Modified: trunk/htdocs/manage/tags.bml.text
===================================================================
--- trunk/htdocs/manage/tags.bml.text	2009-08-20 03:24:07 UTC (rev 15615)
+++ trunk/htdocs/manage/tags.bml.text	2009-08-20 09:24:50 UTC (rev 15616)
@@ -35,6 +35,8 @@
 
 .setting.desc.control=Who can create new tags and add/remove tags from entries?
 
+.setting.author=Entry's author and maintainers
+
 .setting.public=Any user
 
 .setting.friends=Friends only

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments