public function DefinePermissions($UserID, $Serialize = TRUE) {
      if (Gdn::Cache()->ActiveEnabled()) {
         $PermissionsIncrement = $this->GetPermissionsIncrement();
         $UserPermissionsKey = FormatString(self::USERPERMISSIONS_KEY, array(
            'UserID' => $UserID,
            'PermissionsIncrement' => $PermissionsIncrement
         ));
         
         $CachePermissions = Gdn::Cache()->Get($UserPermissionsKey);
         if ($CachePermissions !== Gdn_Cache::CACHEOP_FAILURE) 
            return $CachePermissions;
      }
      
      $Data = Gdn::PermissionModel()->CachePermissions($UserID);
      $Permissions = UserModel::CompilePermissions($Data);

      $PermissionsSerialized = NULL;
      if (Gdn::Cache()->ActiveEnabled()) {
         Gdn::Cache()->Store($UserPermissionsKey, $Permissions);
      } else {
         // Save the permissions to the user table
         $PermissionsSerialized = Gdn_Format::Serialize($Permissions);
         if ($UserID > 0)
            $this->SQL->Put('User', array('Permissions' => $PermissionsSerialized), array('UserID' => $UserID));
      }
      
      if ($Serialize && is_null($PermissionsSerialized))
         $PermissionsSerialized = Gdn_Format::Serialize($Permissions);
      
      return $Serialize ? $PermissionsSerialized : $Permissions;
   }