Added new method accessPolicyFromSessionLogin

This commit is contained in:
Francesco Mangiacrapa 2023-01-11 16:46:14 +01:00
parent 408780c6b1
commit 6d7f5b9338
1 changed files with 18 additions and 1 deletions

View File

@ -56,7 +56,7 @@ public class GeportalCheckAccessPolicy {
}
/**
* Checks if is accessible accoding to access policies.
* Checks if is accessible according to access policies.
*
* @param policy the policy
* @param myLogin the my login
@ -91,4 +91,21 @@ public class GeportalCheckAccessPolicy {
return true;
}
/**
* Access policy from session login.
*
* @param mySessionLogin the my session login
* @return the access policy
*/
public static ACCESS_POLICY accessPolicyFromSessionLogin(String mySessionLogin) {
if (mySessionLogin == null || mySessionLogin.isEmpty()) {
// here is not open and the user is not authenticated
return ACCESS_POLICY.OPEN;
}
return ACCESS_POLICY.RESTICTED;
}
}