GitHub user sebbASF opened an issue:

    https://github.com/apache/incubator-ponymail/issues/297

    Enh: simplify rights checking

    At present, access checking is quite complicated:
    
    ```
    local canUse = false
    if doc.private then
        if account then
            if not rights then
                rights = aaa.rights(r, account)
            end
            canUse = utils.canAccessDoc(doc, rights)
        end
    else
        canUse = true
    end
    if canUse then
    ...
    end
    ```
    
    This is because it may be expensive to fetch the rights so it should only 
be done if necessary.
    It would be nice to be able to do something like the following:
    ```
    if utils.canAccessDoc(doc, ...) then
    ...
    end
    ```
    If the caller passed a function to the canAccessDoc() method, the function 
could cache the rights the first time it was called.

----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to