1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / "Single Forum" control & private forums

"Single Forum" control & private forums

9 posts, 0 answered
  1. DeadlyAccurate
    DeadlyAccurate avatar
    5 posts
    Registered:
    28 Jan 2008
    21 Feb 2008
    Link to this post
    How does the "single forum" control work? I read the kb article and the documentation in the PDFs, and I still can't figure out what it actually does. I need to create forums that only certain roles have access to. Is that possible, and is the "single forum" control the way to go about it?
  2. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    22 Feb 2008
    Link to this post
    Hi DeadlyAccurate,

    Actually, to enable forums on your web site, you only need to insert the Forums control on your page. If you do this, you'll have fully functional forums and clicking the forum title will open all its threads in the same page. You can use the Single Forum control if you want the threads to open in another page. To get this to work you need to:
    1. Insert the Single Forum control on a web page and set its AllForumsPage property to point to the page containing the Forums control, otherwise the Back to all forums link won't work.

    2. Set the SingleForumPage property of Forums control to point to the page containing Single Forums control. Thus, when you click on a forum title in the list of forums, all threads in this forum will open in a new page.

    We are not quite sure what you mean by this "create forums that only certain roles have access to".
    If you are talking about the administrative backend, this is easily achievable with the current implementation. Create a user role called for example "No access to forums" and at the Forums tab, click Permissions in the left pane. In the dropdown, select this role and set the View permission to Deny. The users assigned to this role will not be able to access the whole Forums module. 
    With versions 3.1 and 3.2, you won't be able to set this permission per forum, i.e. RoleA has access to ForumA only, RoleB to ForumB, etc. We plan to provide more granular permissions for all modules, not only forums, but we cannot promise when exactly they will be available.

    You can also achieve something similar using a custom provider for modules (PrivateForum). Then you'll be able to set permissions like this: RoleA has permissions for PrivateForum only; RoleB has permissions for the default forums provider. In this case, both roles will be able to view the Forums tab in the admin section, but will be allowed to manage certain forums only.
    For details about creating and adding your own provider, please look at the Developer Manual: Sitefinity Modules > Forums > Forums Provider Customization.

    If you are talking about the public part, you can use the "Deny anonymous authors" property. When you set "Deny anonymous authors", only users that are authenticated and authorized can post in forums. An authorized user is a user who belongs to a role that has Create permissions for the Forums module. Please examine the TIU site, this functionality with forums and forum users is provided there.

    Please let us know if there is some misunderstanding or if you need any further assistance.

    Kind regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Szymon
    Szymon avatar
    22 posts
    Registered:
    04 Jan 2008
    16 Jul 2008
    Link to this post
    Hi,

    I have a very similar requirement but I need to restrict access to certain forums depending on the user role. So some forums need to be visible only to users with RoleA and other with RoleB and so on.

    Would be best to filter the forums automatically on the same page but if thats not possible than I can create separate page for each role and restrict access to the page. But my question is how to effectively restrict access to the forums so only the users in particular role can view and post to it.

    Maybe this is something you consider already as part of the "Permission by Role" feature described on the other thread, but unfortunatelly I can't wait for the next release. Please let me know if this can be implemented by using the the Sitefity's APIs.

    Regards,
    -Szymon

  4. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    18 Jul 2008
    Link to this post
    Hi Szymon,

    This functionality is exactly covered by the feature we plan to release. However, currently we have concentrated our efforts on stabilization and security and do not plan to release new features until the next major version. We cannot give you a specific date for that yet.

    The current API does not allow you to do these granular permissions. The only close solution for now would be to create different providers for Forums and set different permissions for those providers. However, then you would have to do extra effort to display Forums from both providers on the public site.

    Kind regards,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Szymon
    Szymon avatar
    22 posts
    Registered:
    04 Jan 2008
    18 Jul 2008
    Link to this post
    Hi Slavo,

    I've tried the approach you outlined. I've added second provider to the forums section. The trick was to set a distinct applicationName for the other provider. The administration module behaves as expected. I can select the providers from a drop down on the left and it shows me the coresponding forums. There is a small bug where I can select categories from the other provider.

    I created two separate pages for each forums - where one is open and other one is secured. However I have problem with the ForumList control. It seems it doesn't honor the ProviderName setting at all and always displayes only the default provider. I verified this by changing the defaultProvider to the other one and then it was displayed on both pages.

    Please let me know if I'm doing something incorrect or is it a bug in the control.

    Regards,
    -Szymon
  6. Szymon
    Szymon avatar
    22 posts
    Registered:
    04 Jan 2008
    18 Jul 2008
    Link to this post
    Turns out that the Forums controls works fine and I'm able to setup page for the secondary forum. I've submited both problems as support tickets.

    -Szymon
  7. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    21 Jul 2008
    Link to this post
    Hi Szymon,

    We've reproduced the problems and will answer to your questions in the support tickets you've opened.

    Regards,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Adam
    Adam avatar
    7 posts
    Registered:
    12 May 2008
    03 Sep 2008
    Link to this post
    For those who try this and run into the bug where you can only select categories from the default provider, we were able to work around this with the following:

    Add to the top of
    /Sitefinity/Admin/ControlTemplates/Forums/ControlPanelNewForumTemplate.ascx
    and
    /Sitefinity/Admin/ControlTemplates/Forums/ForumSettingsTemplate.ascx

    <%@ Control Language="C#" %> 
     
    <script runat="server"
        protected void ddlForumCategory_DataBinding(object sender, EventArgs e) 
        { 
            ddlForumCategory.DataSourceID = null
     
            Telerik.Forums.ForumManager fm =  
                new Telerik.Forums.ForumManager(((Telerik.Cms.Web.UI.GenericContainer<Telerik.Forums.WebControls.ForumEditor>)(this.Parent)).Owner.ProviderName); 
            ddlForumCategory.DataSource = fm.GetCategories(); 
        } 
    </script> 

    and then replace ddlForumCategory in both files with this:
    <asp:DropDownList ID="ddlForumCategory" runat="server" AppendDataBoundItems="true" OnDataBinding="ddlForumCategory_DataBinding"
        <asp:ListItem Text="None"></asp:ListItem> 
    </asp:DropDownList> 

  9. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    03 Sep 2008
    Link to this post
    Hi Adam,

    Thank you very much for sharing your solution with us. We'll redirect people having this problem to the workaround you've provided in this thread. You telerik points have been updated.

    Sincerely yours,
    Slavo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
9 posts, 0 answered