[xwiki-users] Space drop down list on Main.WebSearch page shows all the XWiki spaces ignoring user rights
Hi, I have a question about the *space drop down list filter* on Main.WebSearch page (You can see what I mean by *space drop down list filter *at http://dl.dropbox.com/u/3688604/websearch-page.png). At the moment the drop down list shows all the spaces, even the ones that the user is not allow to view. I want to be able to show in that filter just the spaces that the current user is allow to view. How can I achieve that? Thanks in advance! Regards, Abel
This is a bug so you should report a JIRA issue on this http://jira.xwiki.org/jira/browse/XE/component/10379 Caty On Sat, Aug 21, 2010 at 03:56, Abel Solórzano Astorga < [email protected]> wrote:
Hi,
I have a question about the *space drop down list filter* on Main.WebSearch page (You can see what I mean by *space drop down list filter *at http://dl.dropbox.com/u/3688604/websearch-page.png). At the moment the drop down list shows all the spaces, even the ones that the user is not allow to view. I want to be able to show in that filter just the spaces that the current user is allow to view. How can I achieve that?
Thanks in advance!
Regards,
Abel _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Abel, what do you understand by "space that the user is not allowed to view"? You can have rights at space level, indeed, but you can also have rights at page level, which override the rights at space level and can grant a user view access to a page in a space he normally does not have view right for. A space a user is not allowed to view is a space for which user does not have the view right and, in addition, for which there is no page inside with rights that override the space rights and grant user view right? If so, then yes I would guess this is a bug, but I would also say it's a bit costly to check, because of the 'in deep' search. Otherwise, to implement it, it would be just editing the search form (Main.WebSearch) and, when populating the spaces list, check the rights on the space using hasAccessLevel functions in the XWiki api. Happy hacking, Anca On 08/21/2010 03:56 AM, Abel Solórzano Astorga wrote:
Hi,
I have a question about the *space drop down list filter* on Main.WebSearch page (You can see what I mean by *space drop down list filter *at http://dl.dropbox.com/u/3688604/websearch-page.png). At the moment the drop down list shows all the spaces, even the ones that the user is not allow to view. I want to be able to show in that filter just the spaces that the current user is allow to view. How can I achieve that?
Thanks in advance!
Regards,
Abel _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Sat, Aug 21, 2010 at 12:10, Anca Luca <[email protected]> wrote:
Hi Abel,
what do you understand by "space that the user is not allowed to view"?
Well I guess he is referring to rights, because "blacklisted" spaces are correctly displayed in the "space drop down list filter".
You can have rights at space level, indeed, but you can also have rights at page level, which override the rights at space level and can grant a user view access to a page in a space he normally does not have view right for.
A space a user is not allowed to view is a space for which user does not have the view right and, in addition, for which there is no page inside with rights that override the space rights and grant user view right? If so, then yes I would guess this is a bug, but I would also say it's a bit costly to check, because of the 'in deep' search.
Otherwise, to implement it, it would be just editing the search form (Main.WebSearch) and, when populating the spaces list, check the rights on the space using hasAccessLevel functions in the XWiki api.
Happy hacking, Anca
On 08/21/2010 03:56 AM, Abel Solórzano Astorga wrote:
Hi,
I have a question about the *space drop down list filter* on Main.WebSearch page (You can see what I mean by *space drop down list filter *at http://dl.dropbox.com/u/3688604/websearch-page.png). At the moment the drop down list shows all the spaces, even the ones that the user is not allow to view. I want to be able to show in that filter just the spaces that the current user is allow to view. How can I achieve that?
Thanks in advance!
Regards,
Abel _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Thanks from your prompt response. Yes I am referring to rights. I am going to create the issue. But I managed to fix it following Anca suggestion. If somebody has the same problem. On Main.WebSearch page you just need to find the line: #if (!$blacklistedSpaces.contains($space)) and replace it with: #if (!$blacklistedSpaces.contains($space) && $xwiki.hasAccessLevel("view",$context.user,"$space.*")) Regards, Abel On Sat, Aug 21, 2010 at 3:40 AM, Ecaterina Valica <[email protected]> wrote:
On Sat, Aug 21, 2010 at 12:10, Anca Luca <[email protected]> wrote:
Hi Abel,
what do you understand by "space that the user is not allowed to view"?
Well I guess he is referring to rights, because "blacklisted" spaces are correctly displayed in the "space drop down list filter".
You can have rights at space level, indeed, but you can also have rights at page level, which override the rights at space level and can grant a user view access to a page in a space he normally does not have view right for.
A space a user is not allowed to view is a space for which user does not have the view right and, in addition, for which there is no page inside with rights that override the space rights and grant user view right? If so, then yes I would guess this is a bug, but I would also say it's a bit costly to check, because of the 'in deep' search.
Otherwise, to implement it, it would be just editing the search form (Main.WebSearch) and, when populating the spaces list, check the rights on the space using hasAccessLevel functions in the XWiki api.
Happy hacking, Anca
On 08/21/2010 03:56 AM, Abel Solórzano Astorga wrote:
Hi,
I have a question about the *space drop down list filter* on Main.WebSearch page (You can see what I mean by *space drop down list filter *at http://dl.dropbox.com/u/3688604/websearch-page.png). At the moment the drop down list shows all the spaces, even the ones that the user is not allow to view. I want to be able to show in that filter just the spaces that the current user is allow to view. How can I achieve that?
Thanks in advance!
Regards,
Abel _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Abel Solórzano Astorga -
Anca Luca -
Ecaterina Valica