Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesWhere are Social Group Owners Stored in DNN?Where are Social Group Owners Stored in DNN?
Previous
 
Next
New Post
3/23/2013 4:26 PM
 

Posting this in the forum as the Exchange is not currently allowing me to post there.

I'm building a utility module for social groups and I want it to be editable by the group's owner.  So I'm trying to understand where a social groups (role) owner is stored in DNN.  I thought it would be the IsOwner column in the UserRoles table....but manually manipulating the value in SQL does not seem to change the core "edit this group" behavior.

Looking for some direction...any help would be appreciated.

 



Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
New Post
3/24/2013 4:06 AM
 

Changing values in core tables is never a good idea - especially in the case of things like Roles - all those sorts of things are pretty aggressively cached.

You should only change dnn core tables using the core api - and in this case - you would also need to flush the user cache before you see any effect - just changing the table would not flush the cache.

This code would d0 what you want for an existing user  or use rc.AddUserRole() form if you are setting a new user to the role:

// Create an instance of the role controller
DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
// Update a user to have is owner status
rc.UpdateUserRole(PortalSettings.PortalId, someUser.userid, someRole.Roleid, RoleStatus.Approved, isOwnerBool, isCancelBool);
// This line clears the user cache for this user
DotNetNuke.Common.Utilities.DataCache.ClearUserCache(PortalSettings.PortalId, item.Username);

Westa

 
New Post
3/24/2013 6:51 AM
 

Steven,

I think that a group's ownership (at least in the Social Groups module) is based on the CreatedByUserID property of the RoleInfo object. Also, DNN 6.2 added to the RoleInfo object a Settings property which is of type Dictionary<string, string> that is used somewhat like ModuleSettings or TabModuleSettings hash table would be for modules. I am not sure if role Settings is intended to be used by module developers for storing their own custom role/group properties but methods are provided on the TestableRoleController to get and update custom role settings values. If a developer does use role settings they should be sure to use a settings key unique to their extension.

Also, I did note that role Settings is being used to store the group's owner's display name with a settings key of "GroupCreatorName".


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/24/2013 10:55 AM
 
Wes,
Yep, I've used the role controller a lot to add roles and flush cache for users in previous custom modules (for example we have a lot of "gated" content behind eNDAs that users need to accept to gain access to an area on the site. For that requirement the RoleContoller works well. In this case I won't be manipulating roles, just checking to see if the logged in user is:

a. - a member of the group they are on
b. - allowed to edit the group they are on (this is done in the core already)

If they are I simply need to expose an edit button to that user within the module.

Bill,
I thought this might be related to CreatedByUserId in Roles at first but it turns out that changing the column "IsOwner" to true in the UserRoles table does expose group edit functionality to additional members. Now to find out where this lives. It' done in the core (exposing the edit group) button but I'm having a hard time finding it in the source code.

I so wish this was documented somewhere.




Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
New Post
3/24/2013 10:58 AM
 
FYI - this module is essentially a simple HTML module that would allow group owners to add content (and sections) to their respective group pages (expanding on the simple group name and group description available now).

My aim is to release this on codeplex once it's stable.


Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesWhere are Social Group Owners Stored in DNN?Where are Social Group Owners Stored in DNN?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out