Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/io/supertokens/storage/postgresql/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -1534,8 +1534,11 @@ public boolean doesRoleExist(String role) throws StorageQueryException {

@Override
public int deleteAllRolesForUser(String userId) throws StorageQueryException {
// TODO
return 0;
try {
return UserRolesQueries.deleteAllRolesForUser(this, userId);
} catch (SQLException e) {
throw new StorageQueryException(e);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,9 @@ public static String[] getRolesThatHavePermission(Start start, String permission
});
}

public static int deleteAllRolesForUser(Start start, String userId) throws SQLException, StorageQueryException {
String QUERY = "DELETE FROM " + getConfig(start).getUserRolesTable() + " WHERE user_id = ?";
return update(start, QUERY, pst -> pst.setString(1, userId));
}

}