This page provides step-by-step instructions on how to add an administrator or user with blog editor permissions to a new or existing Sueetie BlogEngine.NET blog
What Is: Click a Button
This page is divided into two parts, "What Is" and "What Was." In short, if you want to add a blog administrator (designate a user account who can publish to your site blogs), you can now do so in the Sueetie Control Panel, Applications area shown here. Select the user and click "Submit." That completes the process. If you're interested in what that button does behind the scenes, please feel free to continue reading the "What Was" section.

What Was: Process Overview
BlogEngine.NET supports two types of users with permissions to create posts: Administrator and Editor. BlogEngine.NET is configured to use ASPNET Membership and Roles so that it can be integrated with Sueetie Membership. BlogEngine.NET depends on additional user data in SQL to work with ASPNET Membership, like most applications supporting ASPNET Membership. The BlogEngine.NET SQL tables must be populated with user and user role data.
BlogEngine.NET User data snapshot
Below is a snapshot of BlogEngine.NET user data.

As you can see, there's not much to it, so the process of giving user "testguy2" permissions to post to the site will be pretty simple. I should add that this process WILL GO AWAY as more Sueetie sites go online and more administrative processes (like adding blogs and blog users) will be automated. This process will serve to describe the logic when automated, none-the-less. At the time of this writing, the process is a manual one. Painless and quick, but manual.
Let's cover the data logic first. The tables in order shown are be_users, be_userRoles and be_roles. New Sueetie users are entered in be_users when they register. Roles in be_roles are populated by the site setup script.
Sidebar: new roles to support additional blogs must be added to this table. The roles in be_roles match Sueetie site ASPNET Roles and work hand-in-hand with BlogEngine.NET blogs. Members in the "BlogAdministrator" role have ownership permissions for all blogs on a Sueetie Community Site. The additional roles ("SiteBlogEditor" shown here) are blog-specific. We'll see how to assign those in BlogEngine.NET in a bit.
Making Testguy2 a Blog Administrator
Now let's make testguy2 a site-wide Blog Administrator by adding him to the BlogAdministrator Role in the Sueetie Control Panel. That is shown on
this screenshot. We can go back to the SQL tables where we have a single but important task to perform: add testguy2 to the be_userRoles table. We obtain the BlogEngine.NET UserID for testguy2 and the RoleID for the BlogAdministrator role. Our sql command would be
insert into be_userRoles (userid, roleid) values (14,1)"14" is the userID for testguy2, "1" the roleID for the BlogAdministrator role.
That's it.
Making Testguy2 a Blog Editor
There will be times when you create blogs in a Sueetie Community and wish to provide authorship to select members but not full administrative permissions. Currently this role is ASPNET Role-based, a combination of ASPNET and BlogEngine.NET role assignment logic. To scale Sueetie sites that support hundreds or more blogs, using ASPNET Roles is something we will want to avoid. But for to moment we will describe assigning blog authorship sans ownership using ASPNET Roles.
We'll use the main blog of a Sueetie Community Site and make Testguy2 a Blog Editor. We'll start by
adding Testguy2 to the SiteBlogEditor role in the Control Panel. Next we will add testguy2 to be_userRoles, but instead of using "1" for the roleID of the BlogAdministrator role, we'll use "2" for the SiteBlogEditor role.
insert into be_userRoles (userid, roleid) values (14,2)Gummy Bear supports a SiteBlogEditor role out of the box. The initial design of Gummy Bear also hard-codes "SiteBlogEditor" into the following blog files:
- /blog/admin/web.config
- /blog/admin/pages/web.config
- /blog/admin/extension manager/web.config
- /blog/themes/[theme]/site.master.cs
We will want to re-architect that to use an app.config at the very least, or a non ASPNET Roles approach as I mentioned earlier. The good news that adding both a site-wide blog administrator or a specific blog editor is nearly identical.
Add User Profile in BlogEngine.NET
One final step is to add the user's profile in BlogEngine.NET (for both Blog Administrator and Blog Editor roles.) This avoids encountering a runtime error immediately after a post is entered by the new user. The Sueetie Follow User function at the bottom of the post looks for a valid Blog User Profile for the author's Display Name. User profiles are stored as .XML files in /[blog]/app_data/profiles and will not exist until added in BlogEngine.NET Administration. Here's a screenshot of
the runtime error. (Or if HttpCompression is enabled in /[blog]/app_data/settings.xml a screen full of gobbledygook.)
Use the BlogEngine.NET "Profiles" tab to add a profile for your Testguy2 user and you'll be good to go.

Areas on the shortlist for change in future releases
- As I mentioned before, we want to get away from using ASPNET Roles for supporting Blog Editor roles. I really don't like the idea of requiring a role for each blog when anticipating 100's of blogs on a Sueetie Community Site.
- A single Editor role is currently supported in the Gummy Bear release of Sueetie, SiteBlogEditor. That rolename is hard-coded in various locations in BlogEngine.NET config files. We want to move to an app.config value per blog or roll this into the non-ASPNET Role approach to the editor role.
- While BlogEngine.NET uses user profile information in useful ways not enabled in Gummy Bear, we don't need to create a user profile simply to support the Sueetie Follow User function. The best approach to a BlogEngine.NET user profile is to create the /[blog]/app_data/profiles/[username].xml programmatically as part of the Blog Editor creation process when it is added to Sueetie Administrative area.
Top