Skip to content

Commit

Permalink
Item1918: fixed permission check on changeOwner, added some dialog_close
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/TagsPlugin@7842 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OliverKrueger authored and OliverKrueger committed Jun 18, 2010
1 parent f8bbe02 commit fd7b637
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/Foswiki/Plugins/TagsPlugin/ChangeOwner.pm
Expand Up @@ -21,7 +21,7 @@ use warnings;
use Error qw(:try);
use Encode ();

use constant DEBUG => 0; # toggle me
use constant DEBUG => 1; # toggle me

=begin TML
Expand All @@ -42,6 +42,9 @@ sub rest {
( defined $query->param('public') ) ? $query->param('public') : '1';
my $redirectto = $query->param('redirectto') || '';

my $current_user = Foswiki::Func::getWikiName();
my $tagAdminGroup = $Foswiki::cfg{TagsPlugin}{TagAdminGroup} || "AdminGroup";

$item = Foswiki::Sandbox::untaintUnchecked($item);
$tag = Foswiki::Sandbox::untaintUnchecked($tag);
$user = Foswiki::Sandbox::untaintUnchecked($user);
Expand Down Expand Up @@ -100,9 +103,10 @@ sub rest {
return "<h1>400 'public' is not 0 or 1</h1>";
}

if ( $user ne Foswiki::Func::getWikiName()
&& not Foswiki::Func::isGroupMember( $user,
Foswiki::Func::getWikiName() ) )
if ( $user ne $current_user
&& not Foswiki::Func::isGroupMember(
$tagAdminGroup, Foswiki::Func::getWikiName()
) )
{
$session->{response}->status(403);
return "<h1>403 Forbidden</h1>";
Expand Down
4 changes: 4 additions & 0 deletions pub/System/TagsPlugin/tagsplugin-base.js
Expand Up @@ -119,6 +119,7 @@
},
complete: function(xhr, statusText) {
settings.completed();
$("#tagsplugin_dialog_details").dialog("close");
$(".tagsplugin_update_observer").trigger("tagsplugin_update");
}
}
Expand All @@ -142,6 +143,7 @@
},
complete: function(xhr, statusText) {
settings.completed();
$("#tagsplugin_dialog_details").dialog("close");
$(".tagsplugin_update_observer").trigger("tagsplugin_update");
}
}
Expand All @@ -165,6 +167,7 @@
},
complete: function(xhr, statusText) {
settings.completed();
$("#tagsplugin_dialog_details").dialog("close");
$(".tagsplugin_update_observer").trigger("tagsplugin_update");
}
}
Expand Down Expand Up @@ -194,6 +197,7 @@
},
complete: function(xhr, statusText) {
settings.completed();
$("#tagsplugin_dialog_details").dialog("close");
$(".tagsplugin_update_observer").trigger("tagsplugin_update");
}
}
Expand Down

0 comments on commit fd7b637

Please sign in to comment.