From 77921ad968bb09d83a6d2e839f98f1958761aa23 Mon Sep 17 00:00:00 2001 From: Martin D Date: Thu, 27 Oct 2016 11:41:38 -0400 Subject: [PATCH] Add permissions argument for createCategory method Example: ```$permission = array('groupName' => 1); // 1 being the permission level (1 = Full, 2 = Create Post, 3 = Read Only)``` --- lib/DiscourseAPI.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/DiscourseAPI.php b/lib/DiscourseAPI.php index 180331a..cd74cc4 100644 --- a/lib/DiscourseAPI.php +++ b/lib/DiscourseAPI.php @@ -254,12 +254,13 @@ function getUserByExternalID($externalID) * @return mixed HTTP return code and API return object */ - function createCategory($categoryName, $color, $textColor = '000000', $userName = 'system') + function createCategory($categoryName, $color, $textColor = '000000', $userName = 'system', $permissions = array()) { $params = array( 'name' => $categoryName, 'color' => $color, - 'text_color' => $textColor + 'text_color' => $textColor, + 'permissions' => $permissions ); return $this->_postRequest('/categories', $params, $userName); }