> I have an idea for a simple security architecture and would like to
> implement it within the java.security package but I am very confused
> by the framework.
that's normal. ;-)
> What I want to do is assign a user to a role (or multiple roles). A
> role would consist of a list of Capabilities (are these Permissions?)
[quoted text clipped - 11 lines]
>
> Is what I am calling a capability a Permission?
it can be implemented as such.
> Can I use the concept of levels (integers) for a single Permission?
each permission class has a set of names (values), which are strings.
you don't need integers but can use the implies() method. so in your
case delete implies add, etc.
role based access can be implemented using the classes in the
java.security.acl package. define a role as a group that holds people
(principals) who currently play that role. unfortunately, the
acl-package only contains interfaces, so you will have to implement
everything yourself. maybe you write your own easier api for your purpose.
JK
Robert Paris - 12 Feb 2004 18:44 GMT
Just use JAAS. It's included in Java 1.4 and is an optional package for 1.3.