[xwiki-devs] [PROPOSAL] Add bridge to a access user rights on a document
HI devs, For http://jira.xwiki.org/jira/browse/XWIKI-2880 I need to know if the current user has view right on a specified document. For this there is many solutions, lets proposes some: 1) just add a isDocumentViewable(String documentName) in DocumentAccessBridge and see later if we need more 2) add a more generic hasAccessRights(String documentName, String rightLevel) in DocumentAccessBridge 3) or even more generic hasAccessRights(String user, String documentName, String rightLevel) in DocumentAccessBridge 4) all of this ... Since it's a bridge, I prefer 1) for now, that way component does not need to know exactly what means that a document is readable/viewable and that it needs to use the right level identifier "view". At some point we will need to define a real rights component api and I think we should wait for it before refactoring in component anything that need a lots more that isDocumentViewable. WDYT ? Thanks, -- Thomas Mortagne
Thomas Mortagne wrote:
HI devs,
For http://jira.xwiki.org/jira/browse/XWIKI-2880 I need to know if the current user has view right on a specified document.
For this there is many solutions, lets proposes some: 1) just add a isDocumentViewable(String documentName) in DocumentAccessBridge and see later if we need more 2) add a more generic hasAccessRights(String documentName, String rightLevel) in DocumentAccessBridge 3) or even more generic hasAccessRights(String user, String documentName, String rightLevel) in DocumentAccessBridge 4) all of this ...
Since it's a bridge, I prefer 1) for now, that way component does not need to know exactly what means that a document is readable/viewable and that it needs to use the right level identifier "view". At some point we will need to define a real rights component api and I think we should wait for it before refactoring in component anything that need a lots more that isDocumentViewable.
WDYT ?
+1 not to make aware the components of the different rights levels. So is viewable sounds ok to me. Jerome.
Thanks,
Thomas Mortagne wrote:
HI devs,
For http://jira.xwiki.org/jira/browse/XWIKI-2880 I need to know if the current user has view right on a specified document.
For this there is many solutions, lets proposes some: 1) just add a isDocumentViewable(String documentName) in DocumentAccessBridge and see later if we need more 2) add a more generic hasAccessRights(String documentName, String rightLevel) in DocumentAccessBridge 3) or even more generic hasAccessRights(String user, String documentName, String rightLevel) in DocumentAccessBridge 4) all of this ...
Since it's a bridge, I prefer 1) for now, that way component does not need to know exactly what means that a document is readable/viewable and that it needs to use the right level identifier "view". At some point we will need to define a real rights component api and I think we should wait for it before refactoring in component anything that need a lots more that isDocumentViewable.
WDYT ?
I'm fine with 1).
Thanks,
Thomas Mortagne wrote:
HI devs,
For http://jira.xwiki.org/jira/browse/XWIKI-2880 I need to know if the current user has view right on a specified document.
For this there is many solutions, lets proposes some: 1) just add a isDocumentViewable(String documentName) in DocumentAccessBridge and see later if we need more 2) add a more generic hasAccessRights(String documentName, String rightLevel) in DocumentAccessBridge 3) or even more generic hasAccessRights(String user, String documentName, String rightLevel) in DocumentAccessBridge 4) all of this ...
Since it's a bridge, I prefer 1) for now, that way component does not need to know exactly what means that a document is readable/viewable and that it needs to use the right level identifier "view". At some point we will need to define a real rights component api and I think we should wait for it before refactoring in component anything that need a lots more that isDocumentViewable.
+1 for 1) -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Dec 8, 2008, at 1:35 PM, Thomas Mortagne wrote:
HI devs,
For http://jira.xwiki.org/jira/browse/XWIKI-2880 I need to know if the current user has view right on a specified document.
For this there is many solutions, lets proposes some: 1) just add a isDocumentViewable(String documentName) in DocumentAccessBridge and see later if we need more 2) add a more generic hasAccessRights(String documentName, String rightLevel) in DocumentAccessBridge 3) or even more generic hasAccessRights(String user, String documentName, String rightLevel) in DocumentAccessBridge 4) all of this ...
Since it's a bridge, I prefer 1) for now, that way component does not need to know exactly what means that a document is readable/viewable and that it needs to use the right level identifier "view". At some point we will need to define a real rights component api and I think we should wait for it before refactoring in component anything that need a lots more that isDocumentViewable.
WDYT ?
+1 for 1 for the sake of doing this quickly (since we need XWIKI-2880 for 1.7). Thanks -Vincent
Done. See http://jira.xwiki.org/jira/browse/XWIKI-2943 On Mon, Dec 8, 2008 at 1:35 PM, Thomas Mortagne <thomas.mortagne@xwiki.com> wrote:
HI devs,
For http://jira.xwiki.org/jira/browse/XWIKI-2880 I need to know if the current user has view right on a specified document.
For this there is many solutions, lets proposes some: 1) just add a isDocumentViewable(String documentName) in DocumentAccessBridge and see later if we need more 2) add a more generic hasAccessRights(String documentName, String rightLevel) in DocumentAccessBridge 3) or even more generic hasAccessRights(String user, String documentName, String rightLevel) in DocumentAccessBridge 4) all of this ...
Since it's a bridge, I prefer 1) for now, that way component does not need to know exactly what means that a document is readable/viewable and that it needs to use the right level identifier "view". At some point we will need to define a real rights component api and I think we should wait for it before refactoring in component anything that need a lots more that isDocumentViewable.
WDYT ?
Thanks, -- Thomas Mortagne
-- Thomas Mortagne
participants (5)
-
Jerome Velociter -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol