srvarey / vaadin-appfoundation

Automatically exported from code.google.com/p/vaadin-appfoundation
0 stars 0 forks source link

NullPointerException when initialize and setup permissions #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Follow steps in
http://code.google.com/p/vaadin-appfoundation/wiki/Authorization:

// Initialize the PermissionManager, this should usually be done in the
application's init method
Permissions.initialize(application, new MemoryPermissionManager());

Role visitors = getVisitorRole();
Role regUsers = getRegisteredUsersRole();
Resource newsFeedView = getNewsFeedView();

Permissions.allow(visitors, "read", newsFeedView);

==> Cause NullPointerException as instance.get() return null.

Workaround: set Permissions instance in constructor
public Permissions(Application application, PermissionManager manager) {
  ...
  instance.set(this);
}

Original issue reported on code.google.com by gwtdevel...@gmail.com on 2 Jun 2010 at 3:53

GoogleCodeExporter commented 8 years ago
Fixed in 1.3.2

Original comment by kimp...@gmail.com on 16 Jun 2010 at 5:16