mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Handle no access to list
Handle user not having access to list with many sharees
This commit is contained in:
parent
0b85980d2a
commit
e528830474
@ -43,7 +43,7 @@ public class ListGetter implements CallHandler{
|
||||
int sharees = 0;
|
||||
boolean verifiedAccess = false;
|
||||
int uiPosition = 1;
|
||||
while ((sharees < 2 && accessResults.next()) || !verifiedAccess) {
|
||||
while (accessResults.next() && (sharees < 2 || !verifiedAccess )) {
|
||||
int permissionLevel = accessResults.getInt("permissionLevel");
|
||||
if (accessResults.getString("userID").equals(cognitoID)) {
|
||||
verifiedAccess = true;
|
||||
@ -56,6 +56,9 @@ public class ListGetter implements CallHandler{
|
||||
sharees++;
|
||||
}
|
||||
}
|
||||
if (!verifiedAccess) {
|
||||
throw new AccessControlException("User " + cognitoID + " does not have ant permission for list " + id);
|
||||
}
|
||||
boolean shared = false;
|
||||
if (sharees > 1) {
|
||||
shared = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user