[xwiki-users] Rights in Space Panels
Hey Guys, does anybody know if it is possible to show or hide the links of the spaces according to the access rights of the user? Happy Coding ;-) Greg
Gregor Speck wrote:
Hey Guys,
does anybody know if it is possible to show or hide the links of the spaces according to the access rights of the user?
Yes it is. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Oh, nice :-) Is it difficult to implement this in our xwiki? can you give me a short tut or a solution to this problem? 2008/10/27 Sergiu Dumitriu <[email protected]>
Gregor Speck wrote:
Hey Guys,
does anybody know if it is possible to show or hide the links of the spaces according to the access rights of the user?
Yes it is.
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
hi, i'm not sure if this is what you want: #if ($xwiki.getUser().isUserInGroup("XWiki.greatgroup")) * [TheLink] #end hth eike On [Mon, 27.10.2008 10:46], Gregor Speck wrote:
Hey Guys,
does anybody know if it is possible to show or hide the links of the spaces according to the access rights of the user?
Happy Coding ;-) Greg _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- email: [email protected] https://www.eknet.org pgp: 481161A0
Hey Eike thx for the help. At the moment i try to use the .hasAccessLevel() method. But it won't work.... Does anybody know where is my mistake? Greetings, Greg ##if($context.user != "XWiki.XWikiGuest") #set($user = $xwiki.getUser()) #set($groups = $xwiki.rightsmanager) #panelheader("Spaces") #set($spaces = $xwiki.spaces) #set($first = true) #foreach($space in $spaces) #if($first) #set($first = false) #else <span class="pitemseparator">|</span> #end $xwiki.hasAccessLevel("view","$context.user","XWiki.$space") #if($space == $doc.space) <span class="panelitem currentspace">[$space>${space}.WebHome]</span> #else <span class="panelitem">[$space>${space}.WebHome]</span> #end #end #panelfooter() ##end 2008/10/27 Eike Kettner <[email protected]>
hi, i'm not sure if this is what you want:
#if ($xwiki.getUser().isUserInGroup("XWiki.greatgroup")) * [TheLink] #end
hth eike
On [Mon, 27.10.2008 10:46], Gregor Speck wrote:
Hey Guys,
does anybody know if it is possible to show or hide the links of the spaces according to the access rights of the user?
Happy Coding ;-) Greg _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- email: [email protected] https://www.eknet.org pgp: 481161A0 _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Gregor Speck wrote:
Hey Eike thx for the help.
At the moment i try to use the .hasAccessLevel() method.
But it won't work....
Does anybody know where is my mistake?
Greetings, Greg
##if($context.user != "XWiki.XWikiGuest") #set($user = $xwiki.getUser()) #set($groups = $xwiki.rightsmanager)
#panelheader("Spaces") #set($spaces = $xwiki.spaces) #set($first = true) #foreach($space in $spaces) #if($first) #set($first = false) #else <span class="pitemseparator">|</span> #end
$xwiki.hasAccessLevel("view","$context.user","XWiki.$space")
The line above. What do you mean by "XWiki.$space"? Don't you mean "${space}.WebHome"?
#if($space == $doc.space) <span class="panelitem currentspace">[$space>${space}.WebHome]</span> #else <span class="panelitem">[$space>${space}.WebHome]</span> #end #end #panelfooter() ##end
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Yeah, thanks, now it works ;) 2008/10/27 Sergiu Dumitriu <[email protected]>
Gregor Speck wrote:
Hey Eike thx for the help.
At the moment i try to use the .hasAccessLevel() method.
But it won't work....
Does anybody know where is my mistake?
Greetings, Greg
##if($context.user != "XWiki.XWikiGuest") #set($user = $xwiki.getUser()) #set($groups = $xwiki.rightsmanager)
#panelheader("Spaces") #set($spaces = $xwiki.spaces) #set($first = true) #foreach($space in $spaces) #if($first) #set($first = false) #else <span class="pitemseparator">|</span> #end
$xwiki.hasAccessLevel("view","$context.user","XWiki.$space")
The line above. What do you mean by "XWiki.$space"? Don't you mean "${space}.WebHome"?
#if($space == $doc.space) <span class="panelitem currentspace">[$space>${space}.WebHome]</span> #else <span class="panelitem">[$space>${space}.WebHome]</span> #end #end #panelfooter() ##end
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Eike Kettner -
Gregor Speck -
Sergiu Dumitriu