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

Forums / General Discussions / Custom Module Permissions

Custom Module Permissions

12 posts, 1 answered
  1. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    13 Mar 2013
    Link to this post
    Hi there,

    I've created a custom module, however am having issues with security. I can only see the inner contents of the module if I'm logged in as an administrator. I've defined security properly (event opened it up to 'Everyone') and yet still a blank page. What's more weird though is the link to this content type appears (so security is partly working), however the page (and the content type heading in the ribbon is also blank).

    Any thoughts?

    Attached is a screenshot...
  2. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    14 Mar 2013
    Link to this post
    I guess my question should be as follows: Why is it so difficult to do what I thought would be something very trivial? I've used Thunder to create a custom module. Works great. Renders find. I'd like to do what I thought would be a trivial task. All I'd like to have is an embedded user control to display reports (I'd use telerik reportviewer). So what I thought all I had to do was to add a reference to my user control in the install method of the module... No?

    public override void Install(SiteInitializer initializer)
    {
    var pageMgr = initializer.PageManager;

    // install the module using Fluent API
    var module = initializer.Installer;

    Guid pageID = Guid.NewGuid();
    module.CreateModulePage(pageID, "ReportsModule")
    .SetOrdinal(1)
    .LocalizeUsing<ReportsModuleResources>()
    .SetTitleLocalized("PageTitle")
    .SetHtmlTitleLocalized("PageHtmlTitle")
    .SetDescriptionLocalized("PageDescription")
    .SetUrlNameLocalized("PageUrlName")
    .AddControl(new Literal()
    {
    Text = "<h1 class=\"sfBreadCrumb\">Module ReportsModule Installed</h1>",
    Mode = LiteralMode.PassThrough
    })
    .PlaceUnder(new Guid("f669d9a7-009d-4d83-ddaa-000000000011"))
    .ShowInNavigation();

    // initialize user control using path
    var control = pageMgr.CreateControl<PageControl>("~/Custom/Modules/Views/ReportViewer.ascx", "Content");

    // get page node and add user control
    var node = pageMgr.GetPageNode(pageID);
    node.Page.Controls.Add(control);

    }

    Why doesn't the above work as expected? If I'm an administrator -- the user control renders (but with a bit of formatting issues -- I think it seems that the css classes that are used within the user control are important?) However, If I'm logged in as any other use -- the control does not render... I'd appreciate anybody's help...
  3. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    14 Mar 2013
    Link to this post
    I've also tried this exact same thing with the 'Hello World' intra site module (watched the video -- it's an old video for sitefintiy 4..but it should still apply to 5)...

    http://www.sitefinity.com/blogs/joshmorales/posts/josh-morales-blog/2011/05/26/creating_intra-site_modules_in_sitefinity_4

    the SAME THING HAPPENS. I'm trying to just create a 'backend' module that only certain users (I've created a role) has access to. The 'Hello World' module only renders if you log in as an administrator. Any other type of role you have created -- where the user is designated as a 'backend user' still does not have the ability to view this module -- the page is just blank.

    What am I missing here???

    Thank you!
  4. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    16 Mar 2013 in reply to Rico
    Link to this post
    I found an old article that helped resolved the issue.
    http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity-/adding-permissions-to-intra-site-modules-testimonials
    Answered
  5. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    21 Mar 2013
    Link to this post
    Thanks for your time.

    I've run into what may be a similar problem. As background I should tell you I'm not an ASP.NET developer but a UI designer and CMS user and I'm trying to implement as much SiteFinity CMS functionality as possible without having to open the hood and call in the developers.

    We have a custom content module with four (4) very typical fields. In the Administration->Permissions section, we've permission'd one Role to have access to that custom content module.

     Then we've assigned various Users to that Role.

    The expected behavior is that permissions associated with the Role would be inherited by Users associated with that Role, but that is not the case.

    The actual behavior is that Users assigned to this Role do not have any access to the custom module I'm referring to. They can't see this content type in the dashboard under the Content menu.

    What am I missing, please? I may be incorrect in my understanding of how SiteFinity handles permissions so please correct me if so. Thanks again
  6. Rico
    Rico avatar
    88 posts
    Registered:
    30 Aug 2012
    22 Mar 2013 in reply to Luke
    Link to this post
    I'm assuming you used the module builder to create his custom module? (not Thunder or your own custom class library project?). I've found there's a slight glitch with permissions for the administration side of things. Even if you assign the role to the permissions of the module, you also have to ensure that each use in that role has 'is a backend user' checked off... other than that it sounds as though you have things configured properly. (you do have the 'is allowed to view' permission atleast set? In the attached screenshot is the permissions for my 'Tests' module -- where only administrators have access to it -- so your role would be defined accordingly...
  7. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    22 Mar 2013 in reply to Rico
    Link to this post
    Thanks for your reply Rico.

    Yes, I used the module builder to create this custom module (not Thunder, not my own project.)

    Yes, I can confirm that Users associated with the Role in question have "BackendUsers" appearing with their other associated Roles in the "USERNAME/ROLES" column of Administration:Users grid.

    Yes, I can confirm that this Role is set as "Allowed to View" for the custom content module in question. Part of the reason it remains a mystery. 

    To reiterate, I've created Custom Module X and configured Role Y to have, at a minimum, "View" permissions for Custom Module X. I've added User Z to Role Y. Logically I would think the permissions would inherit, but that is not the case.

    If anyone else has come across this, please feel free to share ideas! Thanks,

  8. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    26 Mar 2013
    Link to this post
    Hi Luke,

    Have you set the permissions for the content type as well as the module? Earlier versions required you to set those separately. Go to the list page for your module content and on the right, there is a link to set permissions for the items.

    Let me know if you need more information.

    All the best,
    Randy Hodge
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    27 Mar 2013 in reply to Randy Hodge
    Link to this post
    Thanks for your reply Randy.

    Here's what I did.

    1.) Navigated to custom content module's type under "Content" menu.
    2.) On the right side of the screen there's a gray "Manage..." pane, opposite the grid of custom content module entries. Within that pane there is a subheading titled "Settings" with two links beneath it, "Content Types" and "Permissions." I click on "Permissions."
    3.) The system responds with a blank screen. I've attached a screenshot.

    By the way, I'm on 5.4.4010.0 Professional Edition, if that information helps.

    Thanks again, appreciate the assistance.
  10. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    30 Mar 2013
    Link to this post
    Hi Luke,

    Can you please open a support ticket for this? I need to ask you for some sensitive information about your site that should be kept private. Let me know the ticket number when you have done it.

    Thank you in advance.

    Kind regards,
    Randy Hodge
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  11. Luke
    Luke avatar
    56 posts
    Registered:
    18 Mar 2013
    01 Apr 2013 in reply to Randy Hodge
    Link to this post
    Hi Randy, I believe our developer group has posted a ticket for the same issue so I'll let that dialogue run its course first. They are probably in a better position to explain the problem and certainly in a better position to implement any solution likely to involve coding and server restarting etc. Thanks for your time.
  12. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    03 Apr 2013
    Link to this post
    Hi Luke,

    Sounds good. Let us know if you have any more questions.

    Regards,
    Randy Hodge
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
12 posts, 1 answered