Need some osaccess directions/examples

"Ilja" <[email protected]> Sat, 11 Oct 2003 18:49:30 +0200
Newsgroups gmane.comp.java.open-symphony.devel
Message-ID <[email protected]>
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(AccessManager.java:842)
	at com.opensymphony.module.access.AccessManager.addUserToGroup(AccessManager.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