Index: /branches/release-39/lib/MT/CMS/Search.pm
===================================================================
--- /branches/release-39/lib/MT/CMS/Search.pm (revision 2352)
+++ /branches/release-39/lib/MT/CMS/Search.pm (revision 2522)
@@ -406,4 +406,9 @@
         ## if $blog_id is specified. it affects the setup_terms_args.
         if ( $app->param('__mode') eq 'dialog_grant_role' ) {
+            if ($blog_id) {
+                my $perm = $author->permissions($blog_id);
+                return $app->errtrans('Permission denied.')
+                    unless $perm->can_administer_blog;
+            }
             $blog_id = 0;
         }
@@ -446,5 +451,8 @@
             };
         } else {
-            if ( $blog_id || ($type eq 'blog') ) {
+            if ( $blog_id
+              || ( $type eq 'blog' )
+              || ( $app->mode eq 'dialog_grant_role' ) )
+            {
                 $iter = $class->load_iter( \%terms, \%args ) or die $class->errstr;
             }
