Broken permission inheritance in dynamic module content.

Posted by Community Admin on 04-Aug-2018 22:18

Broken permission inheritance in dynamic module content.

All Replies

Posted by Community Admin on 14-Mar-2016 00:00

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.

Posted by Community Admin on 15-Mar-2016 00:00

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.

Posted by Community Admin on 21-Mar-2016 00:00

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
 

Posted by Community Admin on 25-Mar-2016 00:00

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
 

Posted by Community Admin on 25-Mar-2016 00:00

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.

Posted by Community Admin on 28-Mar-2016 00:00

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
 

This thread is closed