Re: Need some osaccess directions/examples

[email protected] Sun, 12 Oct 2003 11:38:04 -0500
Newsgroups gmane.comp.java.open-symphony.devel
Message-ID <[email protected]>
The user and group must exist. Which provider are you using?

SnowWolf

On Saturday, Oct 11, 2003, at 11:49 America/Indianapolis, Ilja wrote:

> Ok, I'm still trying to get osaccess working, however I'm not sure how.
> Can you guys provide me with some basic example on how to create a  
> group,
> a user, a permission and associate them with eachother?
>
> This is now what I've got:
>
> public class OSAccessTest extends HttpServlet
> {
> 	public void doGet(HttpServletRequest request, HttpServletResponse  
> response) throws IOException, ServletException
> 	{
> 		PrintWriter out = response.getWriter();
> 		
> 		try
> 		{
> 			AccessManager am = AccessManager.getInstance();
> 		}
> 		catch (Exception e)
> 		{
> 			// TODO Auto-generated catch block
> 			e.printStackTrace(out);
> 		}
> 	}
> }
>
> This works without errors, so I tried adding:
>
> am.addUserToGroup("Ilja", "Administrators");
>
> but now I get an error:
>
> java.lang.NullPointerException
> 	at  
> com.opensymphony.module.access.AccessManager.addUserToGroup(AccessManag 
> er.java:842)
> 	at  
> com.opensymphony.module.access.AccessManager.addUserToGroup(AccessManag 
> er.java:829)
> 	at org.mathesis.test.OSAccessTest.doGet(OSAccessTest.java:35)
>
> Probably because the user and the group both don't exist?
>
> So how do I create them?
>
> Regards,
>
> Ilja
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> Opensymphony-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-developers
>



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php