]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newgroup.php
Merge branch 'master' into 0.9.x
[quix0rs-gnu-social.git] / actions / newgroup.php
index 95af6415e507b303272226511e737c0900dfb283..42d488e54ebfef3a09bfd7b3ce15a96a01cf2807 100644 (file)
@@ -66,6 +66,13 @@ class NewgroupAction extends Action
             return false;
         }
 
+        $user = common_current_user();
+        $profile = $user->getProfile();
+        if (!$profile->hasRight(Right::CREATEGROUP)) {
+            // TRANS: Client exception thrown when a user tries to create a group while banned.
+            throw new ClientException(_('You are not allowed to create groups on this site.'), 403);
+        }
+
         return true;
     }