Package rife.authentication
Interface SessionAttributes
- All Known Implementing Classes:
Authenticated,Login
public interface SessionAttributes
This interface defines the methods that classes with
SessionAttributes functionalities have to implement.
A SessionAttributes class defines the context in which a session
is being validated. The presence and the value of certain attributes can
influence whether the access to a secured resource is authorized or
prohibited for a particular user.
For example, regular users have access to everything besides in the
administration interface. Resources that are restricted to administrators can
for example have a role attribute that is set to
admin. A SessionValidator instance can detect the
presence of this attribute and act accordingly to verify if the user has the
authorities of the required role (in this case, administrator rights).
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String key) Retrieves the value of a particular attribute.booleanhasAttribute(String key) Checks if a certain attribute is present.
-
Method Details
-
hasAttribute
Checks if a certain attribute is present.- Parameters:
key- The key that identifies the attribute.- Returns:
trueif the attribute was present; orfalseotherwise.- Since:
- 1.0
- See Also:
-
getAttribute
Retrieves the value of a particular attribute.- Parameters:
key- The key that identifies the attribute.- Returns:
- A
Stringinstance with the value of the requested attribute; ornullif the attribute couldn't be found. - Since:
- 1.0
- See Also:
-