...
Code Block |
---|
public List getPermissions()
public void setPermissions(List perms)
public void removePermission(WeblogPermission perms)
public int getUserCount()
public int getAdminUserCount()
|
WeblogEntry
Code Block |
---|
public boolean hasWritePermissions(User user) |
...
|
2.1.1
...
Problem
...
Permissions
...
cannot
...
be
...
managed
...
by
...
external
...
system
...
because
...
the
...
User
...
to
...
Permissions
...
to
...
Weblog
...
relationship
...
is
...
managed
...
by
...
the
...
ORM,
...
the
...
information
...
must
...
be
...
stored
...
in
...
Roller
...
database
...
tables
...
and
...
cannot
...
be
...
externalized
...
and
...
managed
...
by
...
another
...
system.
...
2.1.2
...
Solution:
...
User
...
Permissions
...
API
...
Insead
...
calling
...
ORM
...
supported
...
methods
...
on
...
the
...
Weblog
...
and
...
User
...
classes,
...
the
...
Roller
...
front-end
...
will
...
call
...
the
...
Roller
...
UserManager
...
to
...
access
...
permissions
...
information.
...
We'll
...
add
...
these
...
new
...
methods
...
to
...
accommodate
...
that:
...
UserManager
Code Block |
---|
public Set<WeblogPermission> getWeblogPermissions(Weblog weblog) |
...
public Set<WeblogPermission> getUserPermissions(User user) |
...
public void grantPermissions(WeblogPermission perm, String username) |
...
public void removePermissions(WeblogPermission perm) |
...
public int getUserCount(Weblog weblog) |
...
public int getAdminCount(Weblog weblog) |
Code Block |
---|
To
...
allow
...
us
...
to
...
plugin
...
alternate
...
user
...
management
...
systems
...
Roller's
...
default
...
UserManager
...
implementation
...
will
...
call
...
a
...
User
...
Permissions
...
API
...
interface
...
to
...
store
...
and
...
retrieve
...
permissions:
...
UserPermissions
...
interface
...
methods
Code Block |
---|
public Set<Permissions> getObjectPermissions(String objectClass, String objectId) |
...
public Set<Permissions> getUserPermissions(String username) |
...
public void grantPermissions(Permissions perms, String username) |
...
public void removePermissions(Permissions |
Permissions bean
Code Block |
---|
Permissionsint beanmask |
...
String objectClass |
...
String |
...
obectId
|
Roller will include a User Permissions API that stores data in the Roller database. Other implementations can be plugged in via DI.
...