I was referring to Mayan's custom permission inheritance which is handled 
by the acls.classes.ModelPermission class. This is different than the model 
inheritance used by Django which is limited to just database fields and 
methods. Django's model inheritance is meant to emulate Python's class 
inheritance whose purpose is reduce repetition of code. Mayan permission 
inheritance should be called permission relationships instead to better 
reflect its purpose.

Mayan uses two method of the ModelPermission to determine how an object 
inherit permission from another. In the documents.apps file it is using the 
.register_inheritance to correlate the DocumentPage and the Document model.

        ModelPermission.register_inheritance(
            model=DocumentPage, related='document',
        )

Before that it is using the .register_proxy to correlate the Document model 
with the DocumentType model. I don't understand the difference. I'm tying 
to figure it out before bothering Roberto for an explanation.

On Thursday, March 1, 2018 at 10:14:50 AM UTC-4, LeVon Smoker wrote:
>
> Yes. This specific case is with the DocumentPageResult model which 
> inherits from DocumentPage which inherits from the standard Django model 
> not the Document model. DocumentPage as a 'document' property which I used 
> for my workaround.
>
> Maybe there's a way to trick the function into using the document property 
> in certain cases.
>
> And while I have your attention, (I think) pagination needs to be added to 
> the Cabinets details views and Index views. I ran into a situation where a 
> Cabinet had over 1000 documents and the browser could not handle rendering 
> all of those thumbnails...
>
> And thank you for picking up this great project.
>
> On Wednesday, February 28, 2018 at 8:00:39 PM UTC-5, lonevi...@gmail.com 
> wrote:
>>
>> So to summarize, the document search works but the page search is broken, 
>> using that permissions scheme?
>>
>> Mayan's permission system supports permission inheritance. That means 
>> that if an object is a child object, it will inherit the permission 
>> requirements of its parent. If you hold the view permission for a document 
>> type, you automatically have that same permission for all the documents of 
>> that type and all the pages of the documents of that type. By what you are 
>> describing it seems the pages are not inheriting the permissions of their 
>> parent documents.
>>
>> On Tuesday, January 30, 2018 at 4:07:20 PM UTC-4, Ray Hendricks wrote:
>>>
>>> I have two document types "Default" and "Personal"
>>>
>>> I have two roles "Default Owner" and "Personal Owner"
>>>
>>> I have two Groups "Work" and "Personal"
>>>
>>> Jim is a member of the group "Work" and Kelly is a member of the group 
>>> "Personal"
>>>
>>> The Group "Personal" is a member of the Role "Personal Owner" and the 
>>> Group "Work" is a member of  the the Role "Default Owner"
>>>
>>> This works in that Jim can't view "Personal" documents but Jim also 
>>> can't search pages (he can search documents though).  Is this expected 
>>> behavior?
>>>
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to