Index: featherbb/Model/Api/Api.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- featherbb/Model/Api/Api.php	(date 1462116433000)
+++ featherbb/Model/Api/Api.php	(date 1462120690000)
@@ -67,7 +67,7 @@
         }
 
         // If he is admin or moderator
-        if ($this->user->g_id == ForumEnv::get('FEATHER_ADMIN') || $this->user->g_moderator == '1') {
+        if (User::isAdminMod($this->user)) {
             $this->isAdMod = true;
         }
     }
\ No newline at end of file
Index: featherbb/Model/Api/Post.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- featherbb/Model/Api/Post.php	(date 1462116433000)
+++ featherbb/Model/Api/Post.php	(date 1462120690000)
@@ -12,6 +12,7 @@
 use FeatherBB\Core\Error;
 use FeatherBB\Core\Database as DB;
 use FeatherBB\Core\Utils;
+use FeatherBB\Core\Interfaces\User;
 
 class Post extends Api
 {
@@ -35,20 +36,20 @@
     public function getDeletePermissions($cur_post, $args)
     {
         $mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
-        $is_admmod = ($this->user->g_id == ForumEnv::get('FEATHER_ADMIN') || ($this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array))) ? true : false;
+        $is_admmod = (User::isAdmin($this->user) || (User::isAdminMod($this->user) && array_key_exists($this->user->username, $mods_array))) ? true : false;
 
         $is_topic_post = ($args['id'] == $cur_post['first_post_id']) ? true : false;
 
         // Do we have permission to edit this post?
-        if (($this->user->g_delete_posts == '0' ||
-                ($this->user->g_delete_topics == '0' && $is_topic_post) ||
+        if ((!User::can('post.delete', $this->user) ||
+                (!User::can('post.delete', $this->user) && $is_topic_post) ||
                 $cur_post['poster_id'] != $this->user->id ||
                 $cur_post['closed'] == '1') &&
             !$is_admmod) {
             return json_encode($this->errorMessage, JSON_PRETTY_PRINT);
         }
 
-        if ($is_admmod && $this->user->g_id != ForumEnv::get('FEATHER_ADMIN') && in_array($cur_post['poster_id'], Utils::get_admin_ids())) {
+        if ($is_admmod && !User::isAdmin($this->user) && in_array($cur_post['poster_id'], Utils::get_admin_ids())) {
             return json_encode($this->errorMessage, JSON_PRETTY_PRINT);
         }
 
@@ -59,15 +60,14 @@
     {
         // Sort out who the moderators are and if we are currently a moderator (or an admin)
         $mods_array = ($cur_post['moderators'] != '') ? unserialize($cur_post['moderators']) : array();
+        $is_admmod = (User::isAdmin($this->user) || (User::isAdminMod($this->user) && array_key_exists($this->user->username, $mods_array))) ? true : false;
-        
+
-        $is_admmod = ($this->user->g_id == ForumEnv::get('FEATHER_ADMIN') || ($this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array))) ? true : false;
-
         // Do we have permission to edit this post?
-        if (($this->user->g_edit_posts == '0' || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) {
+        if ((!User::can('post.edit', $this->user) || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) {
             return json_encode($this->errorMessage, JSON_PRETTY_PRINT);
         }
 
-        if ($is_admmod && $this->user->g_id != ForumEnv::get('FEATHER_ADMIN') && in_array($cur_post['poster_id'], Utils::get_admin_ids())) {
+        if ($is_admmod && !User::isAdmin($this->user) && in_array($cur_post['poster_id'], Utils::get_admin_ids())) {
             return json_encode($this->errorMessage, JSON_PRETTY_PRINT);
         }
 
\ No newline at end of file
Index: featherbb/Model/Api/Topic.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- featherbb/Model/Api/Topic.php	(date 1462116433000)
+++ featherbb/Model/Api/Topic.php	(date 1462120690000)
@@ -14,6 +14,7 @@
 use FeatherBB\Core\Track;
 use FeatherBB\Core\Utils;
 use FeatherBB\Core\Url;
+use FeatherBB\Core\Interfaces\User;
 
 class Topic extends Api
 {
@@ -90,11 +91,11 @@
 
         // Sort out who the moderators are and if we are currently a moderator (or an admin)
         $mods_array = ($cur_posting['moderators'] != '') ? unserialize($cur_posting['moderators']) : array();
-        $is_admmod = ($this->user->g_id == ForumEnv::get('FEATHER_ADMIN') || ($this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array))) ? true : false;
+        $is_admmod = (User::isAdmin($this->user) || (User::isAdminMod($this->user) && array_key_exists($this->user->username, $mods_array))) ? true : false;
 
         // Do we have permission to post?
-        if ((($tid && (($cur_posting['post_replies'] == '' && $this->user->g_post_replies == '0') || $cur_posting['post_replies'] == '0')) ||
-                ($fid && (($cur_posting['post_topics'] == '' && $this->user->g_post_topics == '0') || $cur_posting['post_topics'] == '0')) ||
+        if ((($tid && (($cur_posting['post_replies'] == '' && !User::can('topic.reply', $this->user)) || $cur_posting['post_replies'] == '0')) ||
+                ($fid && (($cur_posting['post_topics'] == '' && !User::can('topic.post', $this->user)) || $cur_posting['post_topics'] == '0')) ||
                 (isset($cur_posting['closed']) && $cur_posting['closed'] == '1')) &&
             !$is_admmod) {
             return json_encode($this->errorMessage, JSON_PRETTY_PRINT);
@@ -107,7 +108,7 @@
     {
         // Flood protection
         if (Input::post('preview') != '' && $this->user->last_post != '' && (time() - $this->user->last_post) < Container::get('prefs')->get($this->user, 'post.min_interval')) {
-            $errors[] = sprintf(__('Flood start'), Container::get('prefs')->get($this->user, 'post.min_interval'), Container::get('prefs')->get($this->user, 'post.min_interval') - (time() - $this->user->last_post));
+            $errors[] = sprintf(__('Flood start'), User::getPref('post.min_interval', $this->user), User::getPref('post.min_interval', $this->user) - (time() - $this->user->last_post));
         }
 
         // If it's a new topic
@@ -124,7 +125,7 @@
                 $errors[] = __('No subject after censoring');
             } elseif (Utils::strlen($subject) > 70) {
                 $errors[] = __('Too long subject');
-            } elseif (ForumSettings::get('p_subject_all_caps') == '0' && Utils::is_all_uppercase($subject) && !$this->user->is_admmod) {
+            } elseif (ForumSettings::get('p_subject_all_caps') == '0' && Utils::is_all_uppercase($subject) && !User::isAdminMod($this->user)) {
                 $errors[] = __('All caps subject');
             }
         }
@@ -156,7 +157,7 @@
         // Here we use strlen() not Utils::strlen() as we want to limit the post to FEATHER_MAX_POSTSIZE bytes, not characters
         if (strlen($message) > ForumEnv::get('FEATHER_MAX_POSTSIZE')) {
             $errors[] = sprintf(__('Too long message'), Utils::forum_number_format(ForumEnv::get('FEATHER_MAX_POSTSIZE')));
-        } elseif (ForumSettings::get('p_message_all_caps') == '0' && Utils::is_all_uppercase($message) && !$this->user->is_admmod) {
+        } elseif (ForumSettings::get('p_message_all_caps') == '0' && Utils::is_all_uppercase($message) && !User::isAdminMod($this->user)) {
             $errors[] = __('All caps message');
         }
 
@@ -425,8 +426,8 @@
             $increment = $increment->save();
 
             // Promote this user to a new group if enabled
-            if ($this->user->g_promote_next_group != 0 && $this->user->num_posts + 1 >= $this->user->g_promote_min_posts) {
-                $new_group_id = $this->user->g_promote_next_group;
+            if (User::getPref('promote.next_group', $this->user) && $this->user->num_posts + 1 >= User::getPref('promote.min_posts', $this->user)) {
+                $new_group_id = User::getPref('promote.next_group', $this->user);
                 $promote = DB::for_table('users')
                     ->where('id', $this->user->id)
                     ->find_one()
Index: featherbb/Model/Topic.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- featherbb/Model/Topic.php	(date 1462116433000)
+++ featherbb/Model/Topic.php	(date 1462120690000)
@@ -973,7 +973,7 @@
                 }
             } else {
                 $cur_post['post_actions'][] = '<li class="postreport"><span><a href="'.Router::pathFor('report', ['id' => $cur_post['id']]).'">'.__('Report').'</a></span></li>';
-                if (User::isAdmin() || !in_array($cur_post['poster_id'], $admin_ids)) {
+                if (User::isAdmin() || !in_array($cur_post['poster_id'], Utils::get_admin_ids())) {
                     $cur_post['post_actions'][] = '<li class="postdelete"><span><a href="'.Router::pathFor('deletePost', ['id' => $cur_post['id']]).'">'.__('Delete').'</a></span></li>';
                     $cur_post['post_actions'][] = '<li class="postedit"><span><a href="'.Router::pathFor('editPost', ['id' => $cur_post['id']]).'">'.__('Edit').'</a></span></li>';
                 }
