Search code examples
ektron

Getting Status of Community Group


I have created one community group in ektron workarea and set it's membership as 'Restricted'. I need to access the status of Community Group membership ( whether it's open or restricted) via ektron api.


Solution

  • It's helpful to know what code you've tried, in case you're just off by a minor detail. However, this code will retrieve a Community Group and allow you to determine whether a group is open/restricted or hidden. (Hidden groups are always restricted.)

    So a group can be Open, Restricted, or Restricted & Hidden.

    var CommunityGroupCRUD = new Ektron.Cms.Framework.Community.CommunityGroupManager();
    var Group = CommunityGroupCRUD.GetItem(1);
    if (Group.Enroll)
    {
        context.Response.Write("Open");
    }
    else
    {
        if (Group.Hidden)
        {
            context.Response.Write("Restricted & Hidden");
        }
        else
        {
            context.Response.Write("Restricted");
        }
    }