public class ViewAccessChecker extends Object implements BeforeEnterListener
AccessAnnotationChecker
.
An instance of this class should be added as a BeforeEnterListener
to
the UI
of interest.
Modifier and Type | Field and Description |
---|---|
static String |
SESSION_STORED_REDIRECT |
Modifier | Constructor and Description |
---|---|
|
ViewAccessChecker()
Create an instance.
|
protected |
ViewAccessChecker(AccessAnnotationChecker accessAnnotationChecker)
Creates an instance using the given checker.
|
Modifier and Type | Method and Description |
---|---|
void |
beforeEnter(BeforeEnterEvent beforeEnterEvent)
Callback executed before navigation to attaching Component chain is made.
|
void |
enable()
Enables the access checker.
|
void |
setLoginView(Class<? extends Component> loginView)
Sets the Flow login view to use.
|
void |
setLoginView(String loginUrl)
Sets the Fusion login view to use.
|
public static final String SESSION_STORED_REDIRECT
public ViewAccessChecker()
protected ViewAccessChecker(AccessAnnotationChecker accessAnnotationChecker)
Note that the access checker is disabled by default and can be enabled
using enable()
. You should also set the login view to use using
setLoginView(Class)
or setLoginView(String)
accessAnnotationChecker
- the checker to usepublic void enable()
This must be called for the access checker to perform any checks. By default the access checker is disabled.
public void setLoginView(Class<? extends Component> loginView)
The login view can only be set once and cannot be changed afterwards.
Note that the access checker needs to be separately enabled using
enable()
loginView
- the Flow view to use as login viewpublic void setLoginView(String loginUrl)
The login view can only be set once and cannot be changed afterwards.
Note that the access checker needs to be separately enabled using
enable()
loginUrl
- the Fusion view to use as login viewpublic void beforeEnter(BeforeEnterEvent beforeEnterEvent)
BeforeEnterHandler
beforeEnter
in interface BeforeEnterHandler
beforeEnterEvent
- before navigation event with event detailsCopyright © 2021. All rights reserved.