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 ExtensionsModulesModulesProgrammatically Create Social GroupProgrammatically Create Social Group
Previous
 
Next
New Post
11/23/2015 5:34 PM
 

Hello, I am converting a project management system that i have created as a stand alone application to dnn modules and so far everything is going smoothly, i can create users\roles\upload files etc. though the api, what i am trying to achieve here is that upon creating a project by the project manager i want to automate the creation of a social group and add all the project resources to this particular group so they can collaborate and share documents etc.

 

I have looked almost everywhere and browsed the groups module to no avail (i am the issue here) so if some one can just give me a simple snippet on how to create the group from code behind and assign a user to it i would really appreciate it, thanks

 

btw i am using DNN 7.4.2 and everything i have done is webforms

 
New Post
11/23/2015 7:34 PM
 
a social group is a security role with type set appropriately.
Did you try that?

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
11/24/2015 2:17 AM
 

Hi Sebastian,

 

Actually i found out right after posting here, I am using code below:

  


Dim NewRoleInfo As RoleInfo

            NewRoleInfo = New RoleInfo()

           NewRoleInfo.RoleGroupID = 0 'Kept on trying until i found out that -1 add the role to 'Global Roles

            NewRoleInfo.RoleName = "Group1"

            NewRoleInfo.Description = "A social Group"

            NewRoleInfo.SecurityMode = SecurityMode.SocialGroup

            NewRoleInfo.Status = RoleStatus.Approved

            RoleController.Instance.AddRole(NewRoleInfo)


The RoleGroupID was giving me hard time, Before seeing this i thought that SocialGroups are different than Roles and when i used to read anything about Security Roles i thought that when im done creating a social group i should assign it to a role

 

Thanks again

 
New Post
11/24/2015 3:41 AM
 
usually you use a dedicated role group for Social Groups to be able to filter the Groups module accordingly.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
11/24/2015 3:57 AM
 

Aha, Thanks Sebastian i appreciate it

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesProgrammatically Create Social GroupProgrammatically Create Social Group


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out