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

Forums / Bugs & Issues / Broken permission inheritance in dynamic module content.

Broken permission inheritance in dynamic module content.

6 posts, 1 answered
  1. Alejandro
    Alejandro avatar
    4 posts
    Registered:
    10 Sep 2015
    14 Mar
    Link to this post

    Hi everyone, 

    I inherited a project which has a dynamic module (let's call it Person) and there's a global permission setting specific to Person entries. I was told that this project has been upgraded several times.

    The issue is that if I check some Persons ' permissions I can see the standard message: "This item inherits permissions from its parent.", and the usual functionality is there. Some entries however do not have any inheritance message (or option to break/inherit permissions).

    I started to dig in the database comparing a Person with the correct inheritance and the one without.

    I discovered the broken Person had a missing entry in 'sf_dynmc_cntent_sf_permissions' and didn't have entries in sf_permissions_inheritance_map. I tried inserting the appropriate rows, updating the voa_keygen's sf_permissions_inheritance_map value but with no luck. Since adding the entries didn't fix the issue, I'm inclined to think it may have to do with the child_object_type_name column in the inheritance map table, but I don't know what it relates to.

    Could someone shed any light on any other possible entries I may need to adjust to restore the permission inheritance?

    Sorry for the long post.
    Thanks.

  2. Alejandro
    Alejandro avatar
    4 posts
    Registered:
    10 Sep 2015
    15 Mar in reply to Alejandro
    Link to this post

    I kept searching and found more information from the API than the database.
    Through code I was able to restore the permissions and the inheritance, turns out I was pretty close; there were 2 bit columns that needed updating: inherits_permissions and can_inherit_permissions. 

    Everything is almost solved, I haven't been able to find the ISecuredObject that represents the module so that the Persons can inherit the permissions from that.

  3. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    21 Mar
    Link to this post
    Hello Alejandro,

    Since the project has been upgrade several times, I guess you might be hitting this issue:
    http://www.sitefinity.com/developer-network/knowledge-base/details/unable-to-access-dynamic-items-permissions-section-after-an-upgrade-to-sitefinity-7.3

    After upgrade the already created items permissions are different than the root or administrators only.

    Follow the KB article to resolve the issue if you have fix it already.

    Regards,
    Nikola Zagorchev
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  4. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    25 Mar
    Link to this post
    Hello Alejandro,

    Was the provided information helpful?
    Were you able to resolve the issue on your end? 


    Regards,
    Nikola Zagorchev
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  5. Alejandro
    Alejandro avatar
    4 posts
    Registered:
    10 Sep 2015
    25 Mar in reply to Nikola Zagorchev
    Link to this post

    Hi Nikola,

    Sorry for not answering earlier, it was a busy week.
    I had looked at that issue but to my knowledge previous upgrades had been successful so I didn't apply that fix.

    In the end I was able to solve the issue in code.
    I thought I needed to find the Person's parent object to get it's permissions and establish the permissions inheritance from there.

    It was much simpler although it took me a while to get to it. After making sure all persons had inherits_permissions and can_inherit_permissions set to true I ran this code to simple re-save each person. Sitefinity would then automatically wire the correct inheritance from that.

    var persons = manager.GetDataItems(personType).OrderBy(p => p.LastModified);
    foreach (var person in persons) {
        if (person.Status != ContentLifecycleStatus.Master ||
            person.GetWorkflowItemStatus() != "Published") {
            continue;
        }
            
        var tmp = manager.Lifecycle.CheckOut(person);
        manager.Lifecycle.CheckIn(tmp);
    }
    manager.SaveChanges();

    Thanks for the help.

    Answered
  6. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    28 Mar
    Link to this post
    Hello Alejandro,

    We are glad that you have managed to resolve the issue.

    Regards,
    Nikola Zagorchev
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
6 posts, 1 answered