Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Walter E. Harms 13 posts 33 karma points
    Aug 02, 2010 @ 16:52
    Walter E. Harms
    0

    Setting rights on node.. problem with publish


    Hi,

    I've the following problem. I want to create a node from a usercontrol and i want only one membergroup to have access to it.
    It all seems to work right until the user logs off (or a IIS reset is performed), after that the node is not accesable until a republish entire node is performed.

    here is the code i'm using


                Document doc = NodeLevel.CreateNode(txtFolderName.Text, "Folder" , nodeId);
                doc.getProperty("naam").Value = txtFolderName.Text;
                doc.getProperty("omschrijving").Value = txtDescription.Text;
                Access.ProtectPage(false, nodeId, loginPage, errorPage);
               
                Access.AddMembershipRoleToDocument(nodeId, "groupName");
                doc.Publish(User.GetUser(0));
                umbraco.library.UpdateDocumentCache(doc.Id);
                umbraco.cms.businesslogic.web.Document.RePublishAll();
                umbraco.library.RefreshContent();

    actually my question is how to perform a republish entire site from code, or how to apply the security part in a right way.

    thanks for any suggestions.

    gr. Walter

  • Walter E. Harms 13 posts 33 karma points
    Aug 02, 2010 @ 16:53
    Walter E. Harms
    0

    oeps... version 4.5

     

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Aug 02, 2010 @ 17:21
    Ismail Mayat
    0

    Walter,

    Does it work when you manually set the permission on the page?

    Regards

    Ismail

  • Thomas.R 39 posts 62 karma points
    Aug 02, 2010 @ 18:03
    Thomas.R
    0

    Hi,

    umbraco.library.RefreshContent() does not already republish the entire site ?

  • Sascha Wolter 615 posts 1101 karma points
    Aug 02, 2010 @ 18:17
    Sascha Wolter
    0

    Have you tried doc.XmlGenerate(new XmlDocument); ?

  • Walter E. Harms 13 posts 33 karma points
    Aug 02, 2010 @ 19:44
    Walter E. Harms
    0

    Hi All,

     

    Thanks for your suggestions, @ismail, yes when setting permissions manual it all seems to go well.

    After a little investigation the source code of umbraco it seems that

     umbraco.content.Instance.RefreshContentFromDatabaseAsync();

    is called on republish entired site, and... It solved my problem. I'm not quitte sure what is does, but will try to find out that after finishing this site.

     

    gr. Walter

Please Sign in or register to post replies

Write your reply to:

Draft