Matthias L. Jugel | 18 Sep 07:58
Picon

Re: Protected Page

This would need some hacking in 1.0b2-uttoxeter. It can be achieved  
by using the label mechanism in conjunction with a small script.
It will only protect the content of the snip, not labels, attachments  
or the meta-data, but its a start:

Create a Snip somewhere, like SnipSnap/SecuredContentViewer

Paste the following into this snip:

<%
org.snipsnap.app.Application app = org.snipsnap.app.Application.get();
org.snipsnap.user.User user = app.getUser();
org.snipsnap.user.Roles roles = new org.snipsnap.user.Roles();
roles.add(org.snipsnap.user.Roles.AUTHENTICATED);

if(org.snipsnap.user.Security.hasRoles(user, roles)) {
println(app.getParameters().get("viewed").getXMLContent());
} else {
println("You are not allowed to view the contents of this snip.");
}
%>

Then add a label to this snip, Select TypeLabel and use text/gsp as  
type.
Go back to the normal view of this snip and click [lock] as an admin  
user (important!)

Then go to the snip you want to protect:

add a TypeLabel and select anything (i.e. Summary) and select  
SecuredContentViewer as the view handler.

Now only authenticated users can view your snip.

Leo.

On 18.09.2005, at 05:03, Jeremy Cowgar wrote:

> Is it possible to have a page not visible to people not logged in?  
> or maybe a only a select few people?
>
> Jeremy
>
> _______________________________________________
> SnipSnap-Users Mailing List
> snipsnap-users <at> snipsnap.org | http://snipsnap.org/
> http://snipforge.org/cgi-bin/mailman/listinfo/snipsnap-users
>

--
Mud.DE -- Gemeinschaft Virtueller Welten Deutschland
Matthias L. Jugel http://www.mud.de  Info: info <at> mud.de

Gmane