U - user typepublic interface ServiceAuthentication<U>
ServiceAuthenticationImpl
This service is used in AbstractAuthenticationFilter to verify
user rights for displaying pages using isAllowed(Class) method.
See documentation site for more explanation of using this service and
authentication managment.
public ServiceAuthentication<MyUser> buildServiceAuthentication(
ApplicationStateManager stateManager) {
ServiceAuthentication<yUser> instance =
new ServiceAuthenticationImpl(stateManager);
return instance;
}
Contribute to ApplicationStateManager to instantiate MyUser automatically :
public void contributeApplicationStateManager(
MappedConfiguration<Class<?>,
ApplicationStateContribution> configuration,
final ServiceAuthentication<MyUser> serviceAuthentication) {
ApplicationStateCreator<MyUser> creator =
new ApplicationStateCreator<MyUser>() {
public MyUser create() {
return serviceAuthentication.getNewUserInstance();
}
};
configuration.add(MyUser.class,
new ApplicationStateContribution("session", creator));
}
Created: 3 mai 2010
| Modifier and Type | Method and Description |
|---|---|
U |
getNewUserInstance()
Create a new instance of user.
|
U |
getUserConnected()
Get the current user connected.
|
boolean |
isAllowed(Class<?> page)
Check if the current user is allowed to display this
page. |
boolean |
isUserConnected()
Detect if user is connected.
|
void |
setUserConnected(U user)
Set the connected user to
user. |
boolean isUserConnected()
U getUserConnected()
void setUserConnected(U user)
user.user - that will be connectedboolean isAllowed(Class<?> page)
page.page - to checkU getNewUserInstance()
Copyright © 2010–2016 CodeLutin. All rights reserved.