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